Bug 473958 (CVE-2008-5078)

Summary: CVE-2008-5078 enscript: "epsf" special escape buffer overflows
Product: [Other] Security Response Reporter: Tomas Hoger <thoger>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: atkac, meissner
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-12-19 17:39:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 473089, 473090, 473091, 473093    
Bug Blocks:    
Attachments:
Description Flags
Patch for enscript 1.6.1 for CVE-2008-3863, CVE-2008-4306 and CVE-2008-5078
none
Improved patch none

Description Tomas Hoger 2008-12-01 16:21:50 UTC
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.

Comment 1 Tomas Hoger 2008-12-01 16:29:05 UTC
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).

Comment 3 Adam Tkac 2008-12-04 15:51:14 UTC
Created attachment 325695 [details]
Improved patch

Comment 4 Tomas Hoger 2008-12-15 13:39:11 UTC
Lifting embargo.

Comment 5 Red Hat Product Security 2008-12-19 17:39:29 UTC
This issue was addressed in:

Red Hat Enterprise Linux:
  http://rhn.redhat.com/errata/RHSA-2008-1021.html

Comment 6 Marcus Meissner 2009-02-20 10:58:00 UTC
reading the manpage ... why not just pipe a shell command in @epsf{reboot|} ... 

fixing just the buffer overflow is a bit stupid ;)

Comment 7 Tomas Hoger 2009-02-20 11:14:32 UTC
(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