Global-buffer-overflow in get_unpack_proc in ghostscript

ghostscript Updated 02 Oct 2025

Summary

30/08/2022
N/A
Yes i
Unrated
Not published

OSV-2022-805: Global-buffer-overflow in get_unpack_proc. Affects ghostscript across 2 version ranges.

>= eb9fc0106d45d1ce81ab2c4ae1a3d6e90a8c0164, < 9f8b92bf33fb0bdd20ac2ce2e1164dbce30ac5fb >= ee290c1aebaa172c812f21024af2dbf721fa5865, < 593cc12df5834bf0734b4196d7447e02414f5ba3

Fixed in 593cc12df5834bf0734b4196d7447e02414f5ba3. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Ghostscript is an open-source interpreter for the PostScript language and the PDF file format. It is widely used for rendering and converting documents. The get_unpack_proc function in Ghostscript is responsible for unpacking image data. However, a global-buffer-overflow vulnerability has been discovered in this function, which can lead to a crash or potentially allow an attacker to execute arbitrary code.

Vulnerability Detail

The vulnerability occurs due to a global-buffer-overflow in the get_unpack_proc function. An attacker can exploit this vulnerability by providing a specially crafted image file, which triggers the overflow when the image is processed. This can result in a crash or potentially allow the attacker to execute arbitrary code with the privileges of the Ghostscript process. The vulnerability has been assigned the identifier OSV-2022-805.

How To Fix

Minimum fixed version

593cc12df5834bf0734b4196d7447e02414f5ba3

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a workaround, users can avoid processing untrusted image files with Ghostscript. This can be achieved by implementing input validation and filtering mechanisms to ensure that only trusted image files are processed by Ghostscript.

Conclusion

In conclusion, a global-buffer-overflow vulnerability has been discovered in the get_unpack_proc function of Ghostscript. This vulnerability can lead to a crash or potential code execution. Users are advised to update their installations to a version that includes the fix or implement the suggested workaround. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for ghostscript →

Share this vulnerability

FAQ

Ghostscript is an open-source interpreter for the PostScript language and the PDF file format. It is commonly used for rendering and converting documents.

The vulnerability can lead to a crash or potentially allow an attacker to execute arbitrary code with the privileges of the Ghostscript process.

To fix this vulnerability, update Ghostscript to a version that includes the fix. The fix was implemented in commit 593cc12df5834bf0734b4196d7447e02414f5ba3 or a later one.

Yes, users can avoid processing untrusted image files with Ghostscript as a workaround. Implement input validation and filtering mechanisms to ensure only trusted image files are processed.

For more information about this vulnerability, you can refer to the OSS-Fuzz report at https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50731.

Related vulnerabilities

Recent vulnerabilities recorded for ghostscript.

How To Fix

Minimum fixed version

593cc12df5834bf0734b4196d7447e02414f5ba3

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback