CVE-2025-59798
Unknown Unknown - Not Provided
BaseFortify

Publication date: 2025-09-22

Last updated on: 2025-11-03

Assigner: MITRE

Description
Artifex Ghostscript through 10.05.1 has a stack-based buffer overflow in pdf_write_cmap in devices/vector/gdevpdtw.c.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2025-09-22
Last Modified
2025-11-03
Generated
2026-06-16
AI Q&A
2025-09-22
EPSS Evaluated
2026-06-14
NVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
artifex ghostscript to 10.05.1 (inc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-121 A stack-based buffer overflow condition is a condition where the buffer being overwritten is allocated on the stack (i.e., is a local variable or, rarely, a parameter to a function).
Attack-Flow Graph
AI Quick Actions
Instant insights powered by AI
Executive Summary

CVE-2025-59798 is a stack-based buffer overflow vulnerability in the Ghostscript software, specifically in the function pdf_write_cmap. The issue occurs because the function copies a CMap name into a fixed-size buffer without checking if the name fits, leading to a buffer overflow. This can cause memory corruption on the stack. The vulnerability was fixed by replacing the fixed buffer with dynamic memory allocation to safely handle variable-length CMap names. [1]

Impact Analysis

This vulnerability can lead to memory corruption when processing specially crafted PDF files, potentially causing the Ghostscript process to crash or behave unpredictably. Although the CVSS score indicates low to medium severity with no direct confidentiality or availability impact, it can lead to integrity issues by allowing an attacker to manipulate the processing of PDF text and CMap resources. [1]

Detection Guidance

This vulnerability can be detected by running Ghostscript with AddressSanitizer enabled, which will detect the stack-buffer-overflow error during the memcpy call in the pdf_write_cmap function. Additionally, testing with a proof-of-concept PDF file (such as poc.pdf) that triggers the overflow can help identify the issue. Specific commands would involve compiling Ghostscript with AddressSanitizer and then processing the malicious PDF file to observe the error. [1]

Mitigation Strategies

Immediate mitigation steps include updating Ghostscript to a version that contains the fix committed on May 22, 2025, which replaces the static buffer with dynamic memory allocation to safely handle CMap names. If updating is not immediately possible, avoid processing untrusted PDF files that may contain malicious CMap names to prevent triggering the overflow. [1]

Chat Assistant
Ask questions about this CVE
Hi! I’m here to help you understand CVE-2025-59798. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70
EPSS Chart