Bug 1060630 - (CVE-2001-1593) CVE-2001-1593 a2ps: insecure temporary file use
CVE-2001-1593 a2ps: insecure temporary file use
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Red Hat Product Security
: Security
Depends On: 1060632 1060633
Blocks: 1060631
  Show dependency treegraph
Reported: 2014-02-03 01:06 EST by Murray McAllister
Modified: 2015-03-03 05:16 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-02-03 10:43:55 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Murray McAllister 2014-02-03 01:06:26 EST
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 01:15:42 EST
CVE request: http://www.openwall.com/lists/oss-security/2014/02/03/9
Comment 3 Murray McAllister 2014-02-03 01:22:11 EST
There are currently no patches available for this issue.
Comment 4 Murray McAllister 2014-02-03 01:27:41 EST
Created a2ps tracking bugs for this issue:

Affects: fedora-all [bug 1060632]
Affects: epel-6 [bug 1060633]
Comment 5 Tim Waugh 2014-02-03 10:43:55 EST
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@redhat.com>
- security patch for tmpfile creation from Olaf Kirch <okir@lst.de>

followed the next month by a fix to that patch:

* Mon Feb 12 2001 Tim Waugh <twaugh@redhat.com>
- Fix tmpfile security patch so that it actually _works_ (bug #27155).
Comment 6 Tim Waugh 2014-02-03 10:44:54 EST
Here's the actual patch:
Comment 7 Murray McAllister 2014-02-03 21:38:52 EST
Thanks Tim, apologies for missing that.
Comment 8 Tomas Hoger 2014-02-14 17:52:26 EST
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.