Buffer Overflow Vulnerability in Ghostscript - CVE-2025-27834
Summary
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 < 10.05.0. Fixed in 10.05.0. 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 documents and is a critical component in many software applications. The package is known for its ability to convert files between different formats and is often utilized in printing and document management systems. However, certain versions of Ghostscript are vulnerable to a buffer overflow issue that can be exploited through specially crafted PDF documents.
Vulnerability Detail
CVE-2025-27834 is a buffer overflow vulnerability found in Artifex Ghostscript versions prior to 10.05.0. This vulnerability arises when an oversized Type 4 function is processed in a PDF document, leading to potential memory corruption. If exploited, this could allow an attacker to execute arbitrary code, potentially compromising the system running the affected Ghostscript version. The vulnerability is particularly concerning for applications that rely on Ghostscript for PDF processing, as it could lead to unauthorized access or data breaches.
How To Fix
Minimum fixed version
10.05.0
This is the first release that contains the fix.
sudo apk add --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 they can update to a patched version of Ghostscript. Additionally, implementing strict access controls and monitoring can help mitigate the risk of exploitation.
Conclusion
CVE-2025-27834 represents a significant security risk for users of Ghostscript prior to version 10.05.0. It is crucial for users to update their installations to the latest version to protect against potential exploitation. Additionally, employing workarounds and monitoring tools like Vulert can help manage vulnerabilities effectively.
See every vulnerability recorded for ghostscript →
FAQ
CVE-2025-27834 is a buffer overflow vulnerability in Ghostscript that can be exploited through specially crafted PDF documents.
Ghostscript versions prior to 10.05.0 are affected by this vulnerability.
If exploited, this vulnerability could allow an attacker to execute arbitrary code, potentially compromising your system.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
If you cannot update Ghostscript, avoid opening untrusted PDF documents and consider implementing strict access controls to mitigate risks.
References
Related vulnerabilities
Recent vulnerabilities recorded for ghostscript.