CVE-2024-29507
NoneCVSS
—
EPSS
0.7%
Published
Jul 3, 2024
CISA due date
—
Cloudanix analysis
A flaw in a widely used document-processing tool can let attackers crash the program or run their own code simply by sending a specially crafted file.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Moderate
- Impact
- Other
- Component
- Library
- Class
- Buffer Overflow
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Stack-based buffer overflow triggered when processing oversized or malformed CIDFSubstPath and CIDFSubstFont parameter values in PostScript or PDF input.
Why it matters to the business
Processing untrusted documents can crash rendering services or allow arbitrary code execution, disrupting document workflows, print services, and any downstream systems that rely on Ghostscript for conversion or viewing.
How an attack unfolds
An attacker crafts a PostScript or PDF file containing excessively long values for the CIDFSubstPath or CIDFSubstFont parameters. When Ghostscript parses the file, the oversized data overwrites the stack, potentially leading to a crash or control-flow hijack that executes attacker-supplied code.
How to fix it
Upgrade Ghostscript to version 10.03.0 or later. Where immediate upgrade is not possible, restrict Ghostscript to trusted input only or sandbox its execution.
How to confirm the fix worked
Confirm the installed Ghostscript version is 10.03.0 or newer; re-test with known-malformed CIDFSubstPath/CIDFSubstFont test cases to verify the overflow no longer occurs.
Typical attack path
- Deliver a malicious PostScript/PDF file to a target that invokes Ghostscript (email attachment, web upload, print queue, document converter).
- Ghostscript opens and parses the supplied file, reaching the CIDFSubstPath or CIDFSubstFont handling code.
- The oversized parameter value overflows the stack buffer, corrupting adjacent control data.
- Execution is redirected to attacker-controlled code or the process crashes, achieving denial of service or remote code execution.
How to detect it
Monitor application and system logs for Ghostscript segmentation faults, stack-smashing detections, or abnormal termination when processing PDF/PostScript files; review any security tooling that inspects document conversion pipelines for unexpected process crashes.
What your security team should do
- Prioritize upgrade of all Ghostscript installations to 10.03.0 or newer within normal change windows.
- Add Ghostscript version checks to vulnerability scanning and asset inventory processes.
- Restrict or sandbox Ghostscript usage when processing untrusted documents until upgrades are complete.
The record
Artifex Ghostscript before 10.03.0 sometimes has a stack-based buffer overflow via the CIDFSubstPath and CIDFSubstFont parameters.
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-29509 Artifex Ghostscript before 10.03.0 has a heap-based overflow when PDFPassword (e.g., for… Also affects ghostscript
- CVE-2024-29506 Artifex Ghostscript before 10.03.0 has a stack-based buffer overflow in the… Also affects ghostscript
- CVE-2024-29508 Artifex Ghostscript before 10.03.0 has a heap-based pointer disclosure (observable in a… Also affects ghostscript