Critical Buffer Overflow Vulnerability in Ghostscript Package
Summary
UBUNTU-CVE-2025-27831: An issue was discovered in Artifex Ghostscript before 10.05.0. 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 documents in various formats. The package is integral to many applications that require document manipulation and rendering capabilities. However, it has been found to be vulnerable to a buffer overflow issue that could potentially allow attackers to exploit the system.
Vulnerability Detail
An issue was discovered in Artifex Ghostscript before version 10.05.0. The vulnerability arises from the DOCXWRITE TXTWRITE device, which has a text buffer overflow due to the handling of long characters in the file 'devices/vector/doc_common.c'. This flaw can lead to arbitrary code execution, allowing attackers to compromise the affected system. The CVSS score for this vulnerability is 9.8, indicating a critical level of severity.
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 using the DOCXWRITE TXTWRITE device until the package is updated. This can help mitigate the risk of exploitation until a permanent fix is applied.
Conclusion
The Ghostscript package has a critical vulnerability that can lead to severe security risks. It is crucial for users to update their installations to the latest patched versions to protect their systems. Utilizing tools like Vulert can help monitor for such vulnerabilities effectively.
See every vulnerability recorded for ghostscript →
FAQ
The vulnerability is a buffer overflow that can lead to arbitrary code execution due to improper handling of long characters in Ghostscript.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Visit Vulert Scanner to check your application without needing to sign up.
If exploited, this vulnerability could allow attackers to execute arbitrary code on the affected system, potentially leading to data breaches or system compromise.
Yes, patches are available for both Ubuntu 22.04 LTS and Ubuntu 24.04 LTS. Users should update to the specified fixed versions of Ghostscript.
If immediate updates are not possible, refrain from using the DOCXWRITE TXTWRITE device as a temporary workaround to reduce the risk of exploitation.
References
Related vulnerabilities
Recent vulnerabilities recorded for ghostscript.