Vulnerable Systems:
* Ghostscript version 8.64
* Ghostscript version 8.70
The following vulnerabilities were discovered:
1. A stack overflow in the parser for Ghostscript versions 8.64 and 8.70 occurs when very long identifiers are provided within a PostScript file. By enticing a user to open a maliciously crafted PostScript file, arbitrary code execution can be achieved. This vulnerability was reported to downstream distributions by me on March 4, 2010. An anonymous researcher independently published this vulnerability today (May 11, 2010), prompting this advisory. This issue has been assigned CVE-2010-1869.
2. GhostScript (all tested versions) fails to properly handle infinitely recursive procedure invocations. By providing a PostScript file with a sequence such as:
/A{pop 0 A 0} bind def
/product A 0
the interpreter's internal stack will be overflowed with recursive calls, at which point execution will jump to an attacker-controlled address.This vulnerability can be exploited by enticing a user to open a maliciously crafted PostScript file, achieving arbitrary code execution. This issue has not yet been assigned a CVE identifier.
Workaround:
In the absence of a patch, users are encouraged to discontinue use of Ghostscript or avoid processing untrusted PostScript files.