CVE-2025-59798
Ghostscript vulnerability analysis and mitigation

Overview

CVE-2025-59798 affects Artifex Ghostscript through version 10.05.1. The vulnerability is a stack-based buffer overflow in the pdfwritecmap function located in devices/vector/gdevpdtw.c. The issue was discovered and reported on May 12, 2025, and was fixed on May 22, 2025 (Ghostscript Bug, Ghostscript Commit).

Technical details

The vulnerability exists due to insufficient bounds checking before performing a memcpy operation of the CMap name into a statically allocated buffer in the pdfwritecmap function. The CVSS v3.1 base score for this vulnerability is 4.3 (Medium) with the vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N. The issue is classified as CWE-121 (Stack-based Buffer Overflow) (NVD).

Impact

The vulnerability could allow an attacker to cause a stack buffer overflow through a specially crafted PDF file. When exploited, this could potentially lead to code execution or system crashes when processing PDF documents with maliciously crafted CMap names (Ghostscript Bug).

Mitigation and workarounds

The vulnerability has been fixed in Ghostscript commit 0cae41b23a9669e801211dd4cf97b6dadd6dbdd7. The fix replaces the fixed-size buffer with dynamic allocation based on the actual size of the strings being processed, and adds proper error handling for stream operations. Users should upgrade to a version containing this fix (Ghostscript Commit).

Additional resources


SourceThis report was generated using AI

Related Ghostscript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-7462MEDIUM5.3
  • GhostscriptGhostscript
  • ghostscript
NoYesJul 12, 2025
CVE-2025-59801MEDIUM4.3
  • GhostscriptGhostscript
  • ghostscript
NoNoSep 22, 2025
CVE-2025-59800MEDIUM4.3
  • GhostscriptGhostscript
  • cpe:2.3:a:artifex:ghostscript
NoNoSep 22, 2025
CVE-2025-59799MEDIUM4.3
  • GhostscriptGhostscript
  • cpe:2.3:a:artifex:ghostscript
NoNoSep 22, 2025
CVE-2025-59798MEDIUM4.3
  • GhostscriptGhostscript
  • ghostscript
NoNoSep 22, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management