Upload2Shell: lỗi Ghostscript biến file upload thành cửa chạy lệnh trên WordPress, Roundcube và máy chủ inUpload2Shell: a Ghostscript flaw turns uploaded files into a command-execution door on WordPress, Roundcube and print servers
Mẹo: Dùng Microsoft Edge để nghe giọng đọc tiếng Việt tự nhiên hơn (HoaiMy, NamMinh).Tip: Use Microsoft Edge for more natural Vietnamese read-aloud voices (HoaiMy, NamMinh).

Lỗ hổng Upload2Shell (CVE-2026-125396, điểm CVSS 4.0 là 8.5) trong bộ nạp font Type 1 của Ghostscript cho phép chạy mã tùy ý qua một file tải lên được chế tác đặc biệt — WordPress, Roundcube và máy chủ in CUPS đều dính, hai trong ba đường tấn công không cần nạn nhân thao tác. Bản vá là Ghostscript 10.08.0.The Upload2Shell flaw (CVE-2026-125396, CVSS 4.0 score of 8.5) in Ghostscript's Type 1 font loader allows arbitrary code execution via a specially crafted uploaded file — WordPress, Roundcube and CUPS print servers are all affected, and two of the three attack paths need no victim interaction. The fix is Ghostscript 10.08.0.
Một file tài liệu tưởng như vô hại gửi lên website có thể biến thành lệnh chạy trên máy chủ. Lỗ hổng Upload2Shell trong Ghostscript — công cụ render PDF/PostScript có mặt trong hầu hết máy chủ Linux — cho phép kẻ tấn công chạy mã tùy ý chỉ bằng cách tải lên hoặc gửi một file được chế tác đặc biệt. WordPress, Roundcube và máy chủ in CUPS đều dính, và điểm đáng sợ nhất: ở hai trong ba đường tấn công, nạn nhân không cần bấm vào bất cứ thứ gì.
Diễn biến
Ngày 17/11, hai nhà nghiên cứu Paulos Yibelo và nhóm pwn.ai công bố lỗ hổng Upload2Shell, mã CVE-2026-125396, điểm CVSS 4.0 là 8.5. Lỗi nằm trong bộ nạp font Type 1 của Ghostscript, ảnh hưởng mọi bản Ghostscript trước 10.08.0. Tin tức chi tiết về các đường khai thác được Cyber Security News đăng ngày 22/11. Chưa có ghi nhận tấn công thực tế ngoài phòng thí nghiệm — nhưng mọi mảnh ghép để khai thác đều đã công khai.
Cơ chế tấn công
Ghostscript render file PDF và PostScript — mà PostScript vốn là một ngôn ngữ lập trình mô tả trang, nên render file đồng nghĩa với chạy lệnh trong file. Chế độ -dSAFER của Ghostscript được thiết kế để giới hạn những gì lệnh trong tài liệu được phép chạm tới. Upload2Shell phá vỡ giới hạn đó bằng lỗi use-after-free: bộ nạp font không kiểm tra kiểu dữ liệu trước một thao tác có thể gây lỗi, và lỗi đó làm lộ một thao tác ghi được bảo vệ mà mã trong tài liệu không được phép điều khiển. Kết quả: các nhà nghiên cứu thay đổi được chính cơ chế kiểm tra an toàn của Ghostscript ngay cả khi -dSAFER vẫn bật. Lệnh chạy với quyền của tiến trình render — không tự động thành root, nhưng đủ để chiếm máy chủ web nếu tiến trình đó có quyền rộng.
Một chi tiết trong hồ sơ CVE cũng đáng chú ý: CVE-2026-125396 ghi vector tấn công là local và điểm CVSS 4.0 là 8.5 — nhưng cách ghi đó mô tả lỗi ở tầng trình thông dịch, không mô tả cách file độc đến được trình thông dịch. Trong thực tế, chính các dịch vụ hướng mạng — xem trước media, tạo thumbnail cho email, hàng đợi in — đã mang file tới Ghostscript, nên bề mặt phơi nhiễm rộng hơn nhiều so với nhãn “local” gợi ý.
Phạm vi ảnh hưởng
Ba đường tấn công đã được chứng minh đều dẫn về cùng một Ghostscript chưa vá:
| Dịch vụ | Cách file độc tới được Ghostscript | Điều kiện |
|---|---|---|
| WordPress | Xem trước media qua Imagick/ImageMagick | Cần quyền tải media (vai trò Author trở lên); lỗi lõi WordPress riêng là CVE-2026-65640 |
| Roundcube 1.7.2 | Người nhận chỉ cần mở xem email, máy chủ tự tạo thumbnail qua ImageMagick | Người gửi không cần tài khoản webmail; lệnh chạy dưới quyền www-data |
| CUPS (Debian 13) | Hàng đợi in chia sẻ nhận job in qua mạng không cần xác thực | Không cần thao tác của nạn nhân; lệnh chạy dưới quyền lp |
Ngoài ra, một số form upload công khai của plugin Forminator và Essential Addons for Elementor cũng đưa file tới renderer mà không cần đăng nhập trong cấu hình được thử nghiệm. Ở đường Roundcube, cuộc tấn công còn phụ thuộc vào policy của ImageMagick trên máy chủ cho phép bước chuyển file sang Ghostscript — một policy chặn các định dạng tài liệu sẽ cắt đường này ngay từ đầu. Ở đường CUPS, nhóm nghiên cứu xác nhận chạy được lệnh bằng cách ghi một file đánh dấu dưới tài khoản dịch vụ in lp. Điểm mấu chốt mà nghiên cứu nhấn mạnh: chỉ lưu file chưa kích hoạt Ghostscript — việc render (xem trước, thumbnail, in) mới kích hoạt.
Việc cần làm ngay
Việc cần làm - Cập nhật Ghostscript lên 10.08.0 trở lên; trên Debian 13, bản vá có trong 10.05.1~dfsg-1+deb13u2. Kiểm tra theo gói của distro, đừng chỉ nhìn số phiên bản upstream. - WordPress: cập nhật cả lõi (đã vá đường Imagick ở 7.0.4, backport tới 6.9.7) lẫn Ghostscript; rà soát các form công khai đưa file upload vào Media Library. - Roundcube/CUPS: bật xác thực cho hàng đợi in chia sẻ và giới hạn truy cập mạng; nếu chưa vá được, tạm dừng tạo xem trước/thumbnail tự động cho file không tin cậy. - Kiểm tra cả Ghostscript nằm trong container hoặc gói ứng dụng đóng gói sẵn — cập nhật máy chủ không vá được bản Ghostscript bên trong đó. - Truy vết đúng tiến trình render: việc lưu file không khởi động Ghostscript — bước xem trước, tạo thumbnail hoặc in mới khởi động. Hãy xác định worker nào thực sự render file trên hệ thống của bạn và kiểm tra worker đó đang dùng bản Ghostscript đã vá. - Bật xác thực cho các đường gửi file giúp chặn lượt gửi ẩn danh, nhưng không vá được lỗi gốc — đừng coi xác thực là bản vá thay cho việc cập nhật Ghostscript.
A seemingly harmless document file sent to a website can turn into commands running on the server. The Upload2Shell flaw in Ghostscript — the PDF/PostScript renderer present on most Linux servers — lets an attacker run arbitrary code simply by uploading or sending a specially crafted file. WordPress, Roundcube and CUPS print servers are all affected, and the scariest part: in two of the three attack paths, the victim does not need to click on anything.
Timeline
On Nov 17, researchers Paulos Yibelo and the pwn.ai team disclosed the Upload2Shell flaw, tracked as CVE-2026-125396, with a CVSS 4.0 score of 8.5. The bug sits in Ghostscript's Type 1 font loader and affects every Ghostscript version before 10.08.0. Detailed news of the exploitation paths was published by Cyber Security News on Nov 22. No real-world attacks beyond the lab have been recorded — but every piece needed to exploit it is already public.
Mechanism
Ghostscript renders PDF and PostScript files — and PostScript is itself a page-description programming language, so rendering a file means running the commands inside it. Ghostscript's -dSAFER mode is designed to limit what commands in a document may touch. Upload2Shell breaks that limit through a use-after-free flaw: the font loader does not check a data type before an operation that can fault, and that fault exposes a protected write operation that document code is not allowed to control. The result: the researchers changed Ghostscript's own safety-checking mechanism even while -dSAFER stayed on. Commands run with the render process's privileges — not automatically root, but enough to take over a web server if that process has broad rights.
One detail in the CVE record is also worth noting: CVE-2026-125396 lists a local attack vector with a CVSS 4.0 score of 8.5 — but that describes the flaw at the interpreter level, not how a document arrives there. In practice, network-facing services — media previews, email thumbnail generation, print queues — delivered the files to Ghostscript, so the real exposure is much wider than the “local” label suggests.
Scope of impact
All three proven attack paths lead back to the same unpatched Ghostscript:
| Service | How the malicious file reaches Ghostscript | Conditions |
|---|---|---|
| WordPress | Media preview via Imagick/ImageMagick | Requires media-upload permission (Author role or above); the separate WordPress core flaw is CVE-2026-65640 |
| Roundcube 1.7.2 | The recipient only opens the email; the server auto-generates thumbnails via ImageMagick | The sender needs no webmail account; commands run as www-data |
| CUPS (Debian 13) | A shared print queue accepts print jobs over the network without authentication | No victim action needed; commands run as lp |
In addition, some public upload forms of the Forminator and Essential Addons for Elementor plugins also pass files to the renderer without login in the tested configurations. On the Roundcube path, the attack also depended on the server's ImageMagick policy allowing the handoff to Ghostscript — a policy that blocks document formats cuts this path off at the start. On the CUPS path, the researchers confirmed command execution by writing a marker file as the lp print service account. The key point the research stresses: merely storing a file does not trigger Ghostscript — rendering it (preview, thumbnail, printing) is what triggers it.
What to do now
What to do - Update Ghostscript to 10.08.0 or later; on Debian 13, the fix is in 10.05.1~dfsg-1+deb13u2. Check by your distro's package, not just the upstream version number. - WordPress: update both the core (the Imagick path was patched in 7.0.4, backported to 6.9.7) and Ghostscript; review public forms that feed uploads into the Media Library. - Roundcube/CUPS: enable authentication for shared print queues and restrict network access; if you cannot patch yet, temporarily stop automatic preview/thumbnail generation for untrusted files. - Also check Ghostscript copies inside containers or bundled application packages — updating the host does not patch the Ghostscript inside them. - Trace the actual rendering worker: storing a file does not start Ghostscript — previewing, thumbnailing or printing does. Identify which worker really renders files on your system and verify that worker uses the patched Ghostscript package. - Requiring authentication blocks anonymous submissions, but it does not repair the underlying flaw — do not treat authentication as a substitute for updating Ghostscript.
Nguồn tham chiếuSource: Cyber Security News

