Buffer Overflow Vulnerability in Ghostscript Package: CVE-2025-27834
Summary
UBUNTU-CVE-2025-27834: An issue was discovered in Artifex Ghostscript before 10.05.0. A buffer overflow occurs via an oversized Type 4 function in a PDF document to pdf/pdf_func.c. Affects ghostscript versions < 9.55.0~dfsg1-0ubuntu5.11. Fixed in 9.55.0~dfsg1-0ubuntu5.11. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Ghostscript is an interpreter for the PostScript language and for PDF. It is widely used for processing and rendering PDF files and is a crucial component in many software applications that require document manipulation. The package is known for its versatility and ability to handle various file formats, making it a popular choice among developers. However, recent vulnerabilities have raised concerns about its security, particularly regarding buffer overflow issues.
Vulnerability Detail
An issue was discovered in Artifex Ghostscript before version 10.05.0, where a buffer overflow occurs via an oversized Type 4 function in a PDF document, specifically in the pdf/pdf_func.c file. This vulnerability can lead to potential exploitation, allowing attackers to execute arbitrary code, which may compromise the integrity and confidentiality of the system. The CVSS score for this vulnerability is 7.8, indicating a high severity level.
How To Fix
Minimum fixed version
9.55.0~dfsg1-0ubuntu5.11
This is the first release that contains the fix.
sudo apt-get install --only-upgrade ghostscript
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, users can avoid opening untrusted PDF documents that may exploit this vulnerability until the package is updated. Additionally, consider using alternative PDF processing tools that are not affected by this issue.
Conclusion
The buffer overflow vulnerability in Ghostscript (CVE-2025-27834) poses significant risks to users, allowing for potential exploitation through malicious PDF documents. It is crucial to update to the latest patched versions of the package to ensure system security. Users are encouraged to monitor their applications for vulnerabilities using tools like Vulert.
See every vulnerability recorded for ghostscript →
FAQ
CVE-2025-27834 is a buffer overflow vulnerability found in the Ghostscript package, which can be exploited through specially crafted PDF documents.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without any signup.
Exploitation of this vulnerability can lead to arbitrary code execution, potentially compromising system security and data integrity.
Yes, patched versions of Ghostscript are available for both Ubuntu 22.04 LTS and 24.04 LTS. Users should update to the latest versions to mitigate the risk.
If immediate updating is not possible, avoid opening untrusted PDF files and consider using alternative software for PDF processing.
References
Related vulnerabilities
Recent vulnerabilities recorded for ghostscript.