Ghostscript's Upload2Shell Flaw, CVE-2026-125396, Escapes -dSAFER and Is Fixed in 10.08.0
Security / news
Ghostscript's Upload2Shell Flaw, CVE-2026-125396, Escapes -dSAFER and Is Fixed in 10.08.0
The flaw is scored 7.8 to 8.5 as a local bug, yet researchers confirmed command execution through CUPS print queues, Roundcube message view and WordPress uploads.
A crafted PostScript or PDF file can run commands on a server that renders it with Ghostscript before version 10.08.0 (a use-after-free that escapes the -dSAFER sandbox, no authentication needed where uploads are public). Researcher Paulos Yibelo of pwn.ai published the write-up, which he calls Upload2Shell, and the CVE is CVE-2026-125396.
The fix is to upgrade to Ghostscript 10.08.0 or to install a distribution backport. Debian 13 and Ubuntu shipped patched packages in September and October, while Amazon Linux 2, 2023 and 2027 Preview still list the package as "Pending Fix" on its CVE page.
What the flaw does
The CVE record describes a "-dSAFER bypass vulnerability in the .putgstringcopy procedure". That procedure, in gs_fonts.ps, "calls the privileged .forceput operator without checking operand types". A document can trigger a type error, recover .forceput through a custom error handler, and then reach a use-after-free across save and restore, per VulnCheck's advisory. The result is code execution as whatever user owns the rendering process.
Yibelo's page lists affected paths that never touch a terminal: an anonymous IPP print job to a shared CUPS queue on Debian 13 (running as uid=7(lp)), an email attachment that Roundcube 1.7.2 renders on message view, and a signed-out upload form. Command execution on Roundcube ran as uid=33(www-data) with no click on the attachment.
The score understates the web exposure
The score understates what the upload paths mean. VulnCheck rates the flaw 8.5 under CVSS 4.0 with the vector AV:L/AC:L/AT:N/PR:N/UI:P. Amazon Linux rates it Important at 7.8 under CVSS 3.1 with AV:L/AC:L/PR:N/UI:R. Both vectors say local attacker, user interaction required.
That description fits a person opening a file in a desktop viewer. It fits a CUPS queue less well, and it does not fit a WordPress media library that converts a PDF on upload, where the "user interaction" is the server's own thumbnailer. Preconditions vary by product, and several need a login or a capability. WordPress core needs the upload_files capability, for example.
- VulnCheck, CVSS 4.08.5 score out of 10
- Amazon Linux, CVSS 3.17.8 score out of 10
Source: VulnCheck advisory (CVSS 4.0) and Amazon Linux Security Center (CVSS 3.1), accessed 2026-11-21
Who is affected, and which fixes exist
Yibelo's page reports confirmed command execution against products that shell out to Ghostscript, and notes that case studies and proofs of concept are "Not published". It does not claim exploitation in the wild, and none of the three sources fetched for this story reports any.
| Product | Version tested | Fix named on the page |
|---|---|---|
| WordPress core | 7.0.0 to 7.0.3, 6.9.0 to 6.9.6 | CVE-2026-65640, fixed Aug. 12 |
| Roundcube | 1.7.2 | CVE-2026-114727, fixed Oct. 19 |
| Debian 13 | 10.05.1 | 10.05.1~dfsg-1+deb13u3, Oct. 10 |
| Plesk Obsidian | 18.0.79 | None listed |
Plesk is the awkward row. Its stack ships Ghostscript 9.54.0, and the page says AppArmor blocked the shell in one enforced test, with the deployed endpoint untested. Google ran 10.05.0 in a production document-processing path and mitigated it on Nov. 10, per the same page.
Timeline
- July 27: Yibelo discovers the flaw.
- By Sept. 2: reported upstream to Artifex as Bug 709684.
- Sept. 8: Ghostscript 10.08.0 released, per pwn.ai (the upstream release notes page found in search stopped at 10.07.1).
- Sept. 17 and 18: vendor reports sent to Debian, Roundcube, Plesk and others.
- Oct. 21: Ubuntu USN-8949-1 covers seven releases.
- Nov. 6: CVE requested.
- Nov. 9: CVE published, according to pwn.ai and VulnCheck. Amazon lists Nov. 10.
The gap between the Sept. 8 release and the Nov. 9 CVE is 62 days. Debian and Ubuntu patched inside that window, and Roundcube and WordPress had shipped fixes under their own CVE IDs, so a scanner keyed only to CVE-2026-125396 would have missed them.
What to do
Check gs --version on every host that renders untrusted documents. Anything below 10.08.0 without a distribution backport is exposed. Where an upgrade has to wait, stop the rendering path (disable PDF and PostScript thumbnailing, remove the CUPS shared queue) rather than relying on -dSAFER, which is the control this flaw defeats. The same lesson applies to other sandbox layers, as Codex's sandbox design shows, and to how fast a critical advisory chain can outrun a patch. Amazon Linux users should watch the ALAS page for the pending fix.
Sources
More in Security
- 01GPGME's CVE-2026-129975 Double Free Needs Only a Crafted Key, and 2.3.1 Is the FixGnuPG disclosed five days early because GitLab had to update, and no CVSS score exists yet to rank it.
- 02Dragos Seeded 2 Million Prompts With Canaries; Amazon's Decoys Caught ARTEX Agents Grading Stolen AI KeysTwo reports from November 13 and 19 show AI credentials being harvested and spent by machines, and a Chinese lab fetching secrets from ZDR prompts.
- 03REDCap's CVE-2026-90817 Needs Only a Public Survey Hash, and CISA Listed It 59 Days After the CVEVanderbilt's survey platform is fixed in 16.0.49 LTS, 17.3.10 LTS and 17.4.4, and Safe Security reports a miner installed with cron persistence and an SSH key.
- 04LiteLLM's CVE-2026-40217 Is on CISA's KEV List, but Advisory and Google Name Different EndpointsGitLab's advisory says the bug needs a proxy-admin credential, while Google's report says attackers used it to turn standard virtual keys into admin ones.