CVE-2024-29507
ghostscript: stack-based buffer overflow via the CIDFSubstPath and CIDFSubstFont parameters
Severity
ModerateRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · July 3, 2024
Updated · November 21, 2025
Description
A flaw was found in Ghostscript. Under specific conditions, the cidfsubstpath and cidfsubstfont parameters set by corresponding Postscript objects are used to load substitute fonts in pdfi_open_CIDFont_substitute_file. The values are copied via memcpy into the fontfname buffer without bounds checks. This flaw allows an attacker to pass values larger than the buffer size to trigger a stack buffer overflow, leading to a denial of service or other unexpected behavior.
Statement
The buffer overflow vulnerability in Ghostscript, while serious, is categorized as moderate severity due to its limited impact vector and exploitation complexity. The flaw involves unchecked copying of data into a buffer via memcpy when handling the cidfsubstpath and cidfsubstfont parameters. Although this can lead to a stack buffer overflow, resulting in potential denial of service or unexpected behavior, the exploitability is constrained by specific conditions under which the parameters must be set. Furthermore, successful exploitation requires the attacker to have control over the input parameters and the environment in which Ghostscript operates.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.
CVSS / CWE
CVSS 3.1 · 5.4CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L
CWE-121 · Stack-based Buffer Overflow