# AlmaLinux patches Ghostscript 'Upload2Shell' vulnerability (CVE-2026-125396)

> **Key takeaway:** A critical Ghostscript sandbox escape allows remote command execution via crafted PostScript documents through services like CUPS or ImageMagick.

**Published:** 2026-11-22T22:02:02.596629+00:00 
**Source:** AlmaLinux Blog 
**Category:** distro-news 
**Canonical URL:** https://fosswire.org/news/almalinux-patches-ghostscript-upload2shell-vulnerability-cve.html 

## Summary
AlmaLinux has released patched versions of Ghostscript and libgs to address a high-severity vulnerability known as 'Upload2Shell' (CVE-2026-125396). The flaw allows a specially crafted PostScript document to bypass the -dSAFER sandbox, enabling arbitrary command execution with the privileges of the user rendering the file.

Because Ghostscript is frequently utilized as a backend for print queues, image conversion tools, and document previewers, the attack vector can be reached remotely. Affected systems include AlmaLinux 8, 9, and 10. The patched packages are currently available in the AlmaLinux testing repository for verification before a full production rollout.

## Technical breakdown of CVE-2026-125396
- **Vulnerability Mechanism:** The flaw exists in the .putgstringcopy internal helper, which fails to validate operand types when writing to protected font dictionaries.
- **Exploitation Path:** A crafted Type 1 font can trigger an error in the helper, allowing a document's error handler to hijack a privileged write and create a use-after-free condition.
- **Sandbox Escape:** By exploiting the use-after-free, attackers can manipulate the interpreter's native memory to disable the path checks enforced by the -dSAFER security mode.
- **Attack Vectors:** Remote execution is possible via unauthenticated CUPS print jobs, webmail attachment thumbnailing, or web applications using ImageMagick for file previews.

## Why it matters
This vulnerability poses a significant risk to servers running print services (CUPS) or web applications that process user-uploaded images and PDFs. System administrators should prioritize updating Ghostscript and libgs, and consider restricting ImageMagick's ability to invoke PostScript coders via policy.xml until patches are applied.