Heap-use-after-free vulnerability in ghostscript

ghostscript Updated 02 Oct 2025

Summary

12/10/2023
HIGH
Yes i
High
Not published

OSV-2023-1008: Heap-use-after-free in gx_image_enum_begin. Affects ghostscript versions >= 021dcfe4fa68c3b5a3bc12a64d4acfa702309a7d, < d778b932be407d02690cd93df98fb1f891fde289. Fixed in d778b932be407d02690cd93df98fb1f891fde289. 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

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. This vulnerability affects the gx_image_enum_begin function in Ghostscript, which is responsible for enumerating images in a document. The vulnerability allows an attacker to exploit a heap-use-after-free bug, potentially leading to arbitrary code execution or a denial of service.

Vulnerability Detail

The vulnerability originates from a heap-use-after-free bug in the gx_image_enum_begin function. This bug occurs when the function attempts to access a memory region that has already been freed. An attacker can exploit this vulnerability by crafting a malicious document that triggers the bug, potentially leading to arbitrary code execution or a denial of service. The vulnerability has been assigned a high severity rating.

How To Fix

Minimum fixed version

d778b932be407d02690cd93df98fb1f891fde289

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

At the moment, there is no known workaround for this vulnerability. It is advised to update Ghostscript to a patched version as soon as possible.

Conclusion

The heap-use-after-free vulnerability in Ghostscript's gx_image_enum_begin function poses a significant risk, potentially allowing arbitrary code execution or a denial of service. It is crucial to update Ghostscript to a patched version to mitigate this vulnerability. For further support and assistance in 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.

This vulnerability can potentially allow an attacker to execute arbitrary code or cause a denial of service by exploiting the heap-use-after-free bug in Ghostscript.

To fix this vulnerability, it is recommended to update Ghostscript to a version that includes the patch for this issue.

Currently, there is no known workaround for this vulnerability. It is advised to update Ghostscript to a patched version.

You can find more information about this vulnerability in the OSS-Fuzz report linked in the vulnerability details.

Related vulnerabilities

Recent vulnerabilities recorded for ghostscript.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

d778b932be407d02690cd93df98fb1f891fde289

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

Follow Vulert in Google

Get more Vulert vulnerability and dependency-security updates in Google Search and AI results.