Global-buffer-overflow in pdfi_dict_get in ghostscript

ghostscript Updated 02 Oct 2025

Summary

27/12/2021
N/A
Yes i
Unrated
Not published

OSV-2021-1767: Global-buffer-overflow in pdfi_dict_get. Affects ghostscript versions >= 75fbddf52051987287e62d13c659eb73ba16982f, < c7cd63be10c23c712921d9ad7359ddbe5d282e44. Fixed in c7cd63be10c23c712921d9ad7359ddbe5d282e44. 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 in various applications. The vulnerability in question, identified as OSV-2021-1767, is a global buffer overflow in the pdfi_dict_get function of Ghostscript. This function is responsible for retrieving values from a dictionary object within a PDF file. The vulnerability allows an attacker to read beyond the bounds of a buffer, potentially leading to arbitrary code execution or a denial of service.

Vulnerability Detail

The vulnerability arises due to a global buffer overflow in the pdfi_dict_get function of Ghostscript. When processing a maliciously crafted PDF file, the function fails to properly validate the size of a buffer before reading data into it. As a result, an attacker can exploit this flaw to read beyond the bounds of the buffer, potentially accessing sensitive information or executing arbitrary code. The vulnerability has been assigned the identifier OSV-2021-1767 and was reported through the OSS-Fuzz project.

How To Fix

Minimum fixed version

c7cd63be10c23c712921d9ad7359ddbe5d282e44

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 consider implementing input validation and sanitization mechanisms to prevent the processing of maliciously crafted PDF files. Additionally, it is advisable to restrict access to Ghostscript to trusted sources and ensure that the software is kept up to date with the latest security patches.

Conclusion

In conclusion, the vulnerability OSV-2021-1767 in Ghostscript poses a risk of arbitrary code execution or denial of service due to a global buffer overflow in the pdfi_dict_get function. Users are advised to update to a patched version of Ghostscript and consider implementing input validation and access restrictions as additional security measures. 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 in various applications.

The vulnerability allows an attacker to read beyond the bounds of a buffer, potentially leading to arbitrary code execution or a denial of service. This could result in unauthorized access to sensitive information, system compromise, or disruption of services.

To fix this vulnerability, it is recommended to update the affected version of Ghostscript to a patched version that includes the fix for this specific vulnerability. The fix was implemented in commit c7cd63be10c23c712921d9ad7359ddbe5d282e44 in the Ghostscript repository.

As a workaround, users can consider implementing input validation and sanitization mechanisms to prevent the processing of maliciously crafted PDF files. It is also advisable to restrict access to Ghostscript to trusted sources and keep the software up to date with the latest security patches.

This vulnerability was discovered through the OSS-Fuzz project, which performs continuous fuzz testing on open-source software to identify vulnerabilities and improve their security.

Related vulnerabilities

Recent vulnerabilities recorded for ghostscript.

How To Fix

Minimum fixed version

c7cd63be10c23c712921d9ad7359ddbe5d282e44

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