Vigil@nce: GNU Enscript, buffer overflow via escape
October 2008 by Vigil@nce
An attacker can invite the victim to convert a malicious file with GNU Enscript in order to execute code on his computer.
Consequences: user access/rights
Means of attack: 1 attack
Ability of attacker: technician (2/4)
Confidence: unique source (2/5)
Diffusion of the vulnerable configuration: medium (2/3)
Creation date: 23/10/2008
Unix - plateform
The GNU Enscript program converts a text file to PostScript, HTML or RTF.
The "-e" option of enscript enables the support of special patterns escaped by the null character (by default). For example, a text document can contain: \x00bgcolorr g b : indicates the background color \x00fontfontname : indicates the font to use etc.
The read_special_escape() function of the src/psgen.c file analyses these special patterns. When the "font’ pattern is used, the font name (its size can be up to 4096 bytes) is copied to a 512 bytes array, which creates an overflow.
An attacker can therefore create a text file containing a malicious "font" pattern, and invite the victim to open it with "enscript -e" in order to execute code on his computer.
Identifiers: BID-31858, CVE-2008-3863, VIGILANCE-VUL-8197