Bug 1060630 (CVE-2001-1593) - CVE-2001-1593 a2ps: insecure temporary file use
Summary: CVE-2001-1593 a2ps: insecure temporary file use
Alias: CVE-2001-1593
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
Depends On: 1060632 1060633
Blocks: 1060631
TreeView+ depends on / blocked
Reported: 2014-02-03 06:06 UTC by Murray McAllister
Modified: 2021-02-17 06:55 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-02-03 15:43:55 UTC

Attachments (Terms of Use)

Description Murray McAllister 2014-02-03 06:06:26 UTC
Jakub Wilk found that a2ps, a tool to convert text and other types of files to PostScript, insecurely used a temporary file in spy_user(). A local attacker could use this flaw to perform a symbolic link attack to modify an arbitrary file accessible to the user running a2ps.

The original report in the Debian bug tracking system (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=737385) notes the issue is in src/main.c:

559   tempname_ensure (job->tmp_filenames[0]);
560   spyname = job->tmp_filenames[0];
561   spy = fopen (spyname, "w");

And also notes there are other calls to tempname_ensure().

Comment 1 Murray McAllister 2014-02-03 06:15:42 UTC
CVE request: http://www.openwall.com/lists/oss-security/2014/02/03/9

Comment 3 Murray McAllister 2014-02-03 06:22:11 UTC
There are currently no patches available for this issue.

Comment 4 Murray McAllister 2014-02-03 06:27:41 UTC
Created a2ps tracking bugs for this issue:

Affects: fedora-all [bug 1060632]
Affects: epel-6 [bug 1060633]

Comment 5 Tim Waugh 2014-02-03 15:43:55 UTC
Not affected. This has been fixed since 2001 due to a2ps-4.13-security.patch being applied. This patch changes tempname_ensure() so that mkstemp() is used rather than tempnam().

It looks like this was the original patch:

* Fri Jan 05 2001 Preston Brown <pbrown>
- security patch for tmpfile creation from Olaf Kirch <okir>

followed the next month by a fix to that patch:

* Mon Feb 12 2001 Tim Waugh <twaugh>
- Fix tmpfile security patch so that it actually _works_ (bug #27155).

Comment 6 Tim Waugh 2014-02-03 15:44:54 UTC
Here's the actual patch:

Comment 7 Murray McAllister 2014-02-04 02:38:52 UTC
Thanks Tim, apologies for missing that.

Comment 8 Tomas Hoger 2014-02-14 22:52:26 UTC
Already fixed in all Red Hat Enterprise Linux and Fedora a2ps packages.

Note You need to log in before you can comment on or make changes to this bug.