CVE-2024-29506
High · 8.8CVSS
8.8
EPSS
0.9%
Published
Jul 3, 2024
CISA due date
—
Cloudanix analysis
A flaw in software that reads PDF files can let attackers run harmful code or crash systems simply by tricking someone into opening a specially made document.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Remote Code Execution
- Component
- Application
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Stack-based buffer overflow in pdfi_apply_filter() triggered by an excessively long PDF filter name, enabling memory corruption and potential arbitrary code execution.
Why it matters to the business
Attackers can crash document-processing applications or execute code when users open malicious PDFs, disrupting workflows that rely on Ghostscript for rendering or conversion.
How an attack unfolds
An attacker creates a specially crafted PDF containing a filter name longer than the allocated stack buffer. When Ghostscript processes the PDF through pdfi_apply_filter(), the overflow corrupts adjacent memory, allowing control of execution flow.
How to fix it
Upgrade Artifex Ghostscript to version 10.03.0 or later. Until then, restrict processing of untrusted PDFs and apply sandboxing or input validation where possible.
How to confirm the fix worked
Verify installed Ghostscript version is 10.03.0 or newer. Test with known long-filter-name PDFs in a controlled environment and monitor for crashes or unexpected behavior.
Typical attack path
- Craft malicious PDF with oversized filter name
- Deliver PDF to target via email, web, or file share
- Victim opens or processes PDF with vulnerable Ghostscript
- Overflow triggers memory corruption and potential code execution
How to detect it
Review application logs and crash reports for Ghostscript segmentation faults or buffer overflow indicators when processing PDFs. Correlate with file creation or access events involving suspicious PDFs.
What your security team should do
- Immediately upgrade all Ghostscript installations to 10.03.0 or later
- Block or sandbox untrusted PDF processing until patched
- Add version checks to software inventories and CI pipelines
- Monitor for new exploit code or public PoCs
The record
Artifex Ghostscript before 10.03.0 has a stack-based buffer overflow in the pdfi_apply_filter() function via a long PDF filter name.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:12 | ghostscript | 0 | 10.0.0~dfsg-11+deb12u5 |
| Debian:13 | ghostscript | 0 | 10.03.0~dfsg-1 |
| Ubuntu:20.04:LTS | ghostscript | 0 | 9.50~dfsg-5ubuntu4.13 |
| Ubuntu:22.04:LTS | ghostscript | 0 | 9.55.0~dfsg1-0ubuntu5.9 |
| Ubuntu:24.04:LTS | ghostscript | 0 | 10.02.1~dfsg1-0ubuntu7.3 |
Related vulnerabilities
- CVE-2024-46956 An issue was discovered in psi/zfile.c in Artifex Ghostscript before 10.04.0. Also affects ghostscript
- CVE-2024-46955 An issue was discovered in psi/zcolor.c in Artifex Ghostscript before 10.04.0. Also affects ghostscript
- CVE-2024-46953 An issue was discovered in base/gsdevice.c in Artifex Ghostscript before 10.04.0. Also affects ghostscript
- CVE-2024-46952 An issue was discovered in pdf/pdf_xref.c in Artifex Ghostscript before 10.04.0. Also affects ghostscript
- CVE-2024-46951 An issue was discovered in psi/zcolor.c in Artifex Ghostscript before 10.04.0. Also affects ghostscript
- CVE-2024-29507 Artifex Ghostscript before 10.03.0 sometimes has a stack-based buffer overflow via the… Also affects ghostscript
- CVE-2024-29509 Artifex Ghostscript before 10.03.0 has a heap-based overflow when PDFPassword (e.g., for… Also affects ghostscript
- CVE-2024-29508 Artifex Ghostscript before 10.03.0 has a heap-based pointer disclosure (observable in a… Also affects ghostscript