While preparing updates for CVE-2008-3863 and CVE-2008-4306, we have discovered that enscript 1.6.1 (and possibly earlier versions) is affected by similar flaws affecting handling of epsf special escape. Long file name specified as an argument for epsf special escape can cause buffer overflow in recognize_eps_file() in src/psgen.c, or in tilde_subst() in src/util.c due to unsafe use of strcpy or sprintf. Identified flaws do not affect enscript 1.6.4.
Created attachment 325251 [details] Patch for enscript 1.6.1 for CVE-2008-3863, CVE-2008-4306 and CVE-2008-5078 It also prevents few command line arguments parsing overflow, but those are not security flaws (no trust boundary crossed).
Created attachment 325695 [details] Improved patch
Lifting embargo.
This issue was addressed in: Red Hat Enterprise Linux: http://rhn.redhat.com/errata/RHSA-2008-1021.html
reading the manpage ... why not just pipe a shell command in @epsf{reboot|} ... fixing just the buffer overflow is a bit stupid ;)
(In reply to comment #6) > reading the manpage ... why not just pipe a shell command in @epsf{reboot|} ... Because that is denied for quite a long time, at least in all RHEL and Fedora packages: http://cvs.fedoraproject.org/viewvc/rpms/enscript/devel/enscript-1.6.1-CAN-2004-1185.patch?view=markup