CVE-2024-29509
High · 8.8CVSS
8.8
EPSS
1.4%
Published
Jul 3, 2024
CISA due date
—
Cloudanix analysis
A bug in popular PDF processing software can let attackers take control of a computer when someone opens a specially made PDF file.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Moderate
- Impact
- Remote Code Execution
- Component
- Application
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Heap-based buffer overflow triggered when PDFPassword contains a null byte in the middle during PDF processing operations such as runpdf.
Why it matters to the business
Processing of malicious PDF files can lead to arbitrary code execution or application crashes, potentially exposing sensitive documents or disrupting document-handling workflows in environments that rely on Ghostscript.
How an attack unfolds
An attacker creates a PDF file containing a PDFPassword field with an embedded null byte, then delivers the file to a target system. When Ghostscript processes the PDF (for example via runpdf), the null byte causes a heap overflow that an attacker can leverage for code execution.
How to fix it
Upgrade Artifex Ghostscript to version 10.03.0 or later. Verify the installed version and replace any instances of earlier releases.
How to confirm the fix worked
Confirm Ghostscript reports version 10.03.0 or newer. Test processing of a PDF containing a null byte in PDFPassword to ensure no crash or overflow occurs.
Typical attack path
- Craft a malicious PDF embedding a null byte within the PDFPassword field
- Deliver the PDF to a victim via email, download, or shared storage
- Victim opens or processes the PDF using Ghostscript before version 10.03.0
- Heap overflow occurs allowing attacker-controlled memory corruption and potential code execution
How to detect it
Review process execution logs and file access records for Ghostscript invocations on untrusted PDFs; look for crashes or unexpected memory behavior during PDF password handling.
What your security team should do
- Immediately update all Ghostscript installations to 10.03.0 or newer
- Inventory systems and applications that invoke Ghostscript for PDF handling
- Block or sandbox untrusted PDF processing until patches are applied
- Monitor for new exploit development given the memory corruption nature of the flaw
The record
Artifex Ghostscript before 10.03.0 has a heap-based overflow when PDFPassword (e.g., for runpdf) has a \000 byte in the middle.
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-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