<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>75784</bug_id>
          
          <creation_ts>2004-12-27 05:28 0000</creation_ts>
          <short_desc>app-text/a2ps: insecure tempfile vuln in fixps and psmandup</short_desc>
          <delta_ts>2005-01-04 13:40:56 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Security</product>
          <component>Vulnerabilities</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          <bug_file_loc>http://secunia.com/advisories/13641/</bug_file_loc>
          <status_whiteboard>B3 [glsa]</status_whiteboard>
          
          <priority>P2</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>lewk@gentoo.org</reporter>
          <assigned_to>security@gentoo.org</assigned_to>
          <cc>cjk@gentoo.org</cc>
    
    <cc>printing@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>lewk@gentoo.org</who>
            <bug_when>2004-12-27 05:28:06 0000</bug_when>
            <thetext>Description:
Javier Fern</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>lewk@gentoo.org</who>
            <bug_when>2004-12-27 05:28:06 0000</bug_when>
            <thetext>Description:
Javier Fernández-Sanguino Peña has reported two vulnerabilities in GNU a2ps, which can be exploited by malicious, local users to perform certain actions on a vulnerable system with escalated privileges.

The vulnerabilities are caused due to the fixps.in and psmandup.in scripts creating temporary files insecurely. This can be exploited via symlink attacks to overwrite arbitrary files with the privileges of the user running a vulnerable script.

The vulnerabilities have been reported in version 4.13b. Other versions may also be affected.

Solution:
Don&apos;t use the two vulnerable scripts.

Grant only trusted users access to affected systems.

Provided and/or discovered by:
Javier Fernández-Sanguino Peña</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>lewk@gentoo.org</who>
            <bug_when>2004-12-27 05:29:35 0000</bug_when>
            <thetext>printing/cjk, please verify whether or not a2ps-4.13c-r1 is vulnerable to this.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>lewk@gentoo.org</who>
            <bug_when>2004-12-27 05:36:25 0000</bug_when>
            <thetext>I also sent an email upstream to verify this as well.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2004-12-28 02:44:25 0000</bug_when>
            <thetext>Here is another one in a2ps :

--------------------------------------------------------------------------
Debian Security Advisory DSA 612-1
December 20th, 2004 

Package        : a2ps
Vulnerability  : unsanitised input
Problem-Type   : local
Debian-specific: no
CVE ID         : CAN-2004-1170
BugTraq ID     : 11025
Debian Bug     : 283134

Rudolf Polzer discovered a vulnerability in a2ps, a converter and
pretty-printer for many formats to PostScript.  The program did not
escape shell meta characters properly which could lead to the
execution of arbitrary commands as a privileged user if a2ps is
installed as a printer filter.
--------------------------------------------------------------------------
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2004-12-28 02:58:23 0000</bug_when>
            <thetext>Forget about that last comment... was taken care of in bug 61500</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2004-12-28 03:10:18 0000</bug_when>
            <thetext>Created an attachment (id=47020)
fixps.diff

Patch from reporter on http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=286385
Applies correctly and seems harmless, but please doublecheck it.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2004-12-28 03:11:01 0000</bug_when>
            <thetext>Created an attachment (id=47021)
psmandup.diff

Patch from reporter on http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=286387
Applies correctly and seems harless but please double-check it.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2004-12-28 03:13:18 0000</bug_when>
            <thetext>I can confirm that tempfile handling in a2ps could be enhanced (currently relies on $$). Applying the two patches above should improve it.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>usata@gentoo.org</who>
            <bug_when>2005-01-01 22:10:07 0000</bug_when>
            <thetext>I don&apos;t have time to look into this until 17 January.
Could someone from printing herd check these patches
(seems straightforward, though) and apply, please?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>lanius@gentoo.org</who>
            <bug_when>2005-01-03 08:41:06 0000</bug_when>
            <thetext>verified and applied the patches. stable on all arches since it&apos;s only bash</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-01-03 08:57:32 0000</bug_when>
            <thetext>Thanks Heinrich.
security: Please vote on GLSA need</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-01-04 01:35:42 0000</bug_when>
            <thetext>I vote yes. It&apos;s used on more systems than I originally thought.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2005-01-04 01:36:48 0000</bug_when>
            <thetext>Seems like a2ps is somewhat popular so I tend to vote yes on this one.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-01-04 13:40:56 0000</bug_when>
            <thetext>GLSA 200501-02</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>47020</attachid>
            <date>2004-12-28 03:10 0000</date>
            <desc>fixps.diff</desc>
            <filename>fixps.diff</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIGNvbnRyaWIvZml4cHMuaW4ub3JpZwkyMDA0LTEyLTIwIDAwOjExOjQwLjAwMDAwMDAwMCAr
MDEwMAorKysgY29udHJpYi9maXhwcy5pbgkyMDA0LTEyLTIwIDAwOjE0OjEyLjAwMDAwMDAwMCAr
MDEwMApAQCAtMzgsNyArMzgsNyBAQAogcnVuX2dzPTAKICMgV2hhdCBhY3Rpb24gdG8gcGVyZm9y
bTogZml4cHMsIGNhdCwgY2hlY2ssIGFuZCBncwogdGFzaz1maXhwcwotdG1wZGlyPS90bXAvJHBy
b2dyYW0uJCQKK3RtcGRpcj1gbWt0ZW1wIC1kIC10IGZpeHBzLlhYWFhYWGAgfHwgeyBlY2hvICIk
cHJvZ3JhbTogQ2Fubm90IGNyZWF0ZSB0ZW1wb3JhcnkgZGlyISIgPiYyIDsgZXhpdCAxOyB9CiB2
ZXJib3NlPWVjaG8KIAogIyBUaGUgdmVyc2lvbi91c2FnZSBzdHJpbmdzCkBAIC0xOTEsNyArMTkx
LDYgQEAKICAgdHJhcCAiL2Jpbi9ybSAtcmYgJHRtcGRpciIgMCAxIDIgMyAxMyAxNQogZmkKIAot
bWtkaXIgJHRtcGRpcgogZml4cHNfc2VkPSR0bXBkaXIvZml4cHMuc2VkCiAKICMgSWYgcHJpbnRp
bmcgZnJvbSBzdGRpbiwgc2F2ZSBpbnRvIGEgdG1wIGZpbGUK
</data>        

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>47021</attachid>
            <date>2004-12-28 03:11 0000</date>
            <desc>psmandup.diff</desc>
            <filename>psmandup.diff</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIGNvbnRyaWIvcHNtYW5kdXAuaW4ub3JpZwkyMDA0LTEyLTIwIDAwOjE2OjA3LjAwMDAwMDAw
MCArMDEwMAorKysgY29udHJpYi9wc21hbmR1cC5pbgkyMDA0LTEyLTIwIDAwOjE2OjM5LjAwMDAw
MDAwMCArMDEwMApAQCAtMzYsNyArMzYsNyBAQAogbWVzc2FnZT0KIHBzc2VsZWN0PSR7UFNTRUxF
Q1Q6LXBzc2VsZWN0fQogcHNzZXQ9JHtQU1NFVDotcHNzZXR9Ci10bXBkaXI9L3RtcC8kcHJvZ3Jh
bS4kJAordG1wZGlyPWBta3RlbXAgLWQgLXQgZml4cHMuWFhYWFhYYCB8fCB7IGVjaG8gIiRwcm9n
cmFtOiBDYW5ub3QgY3JlYXRlIHRlbXBvcmFyeSBkaXIhIiA+JjIgOyBleGl0IDE7IH0KIAogIyBU
aGVzZSB0d28gbXVzdCBiZSBrZXB0IGluIHN5bmNoLiAgVGhleSBhcmUgb3Bwb3NlZC4KIHZlcmJv
c2U9ZWNobwpAQCAtMTg1LDcgKzE4NSw2IEBACiAgIHRyYXAgIi9iaW4vcm0gLXJmICR0bXBkaXIi
IDAgMSAyIDMgMTMgMTUKIGZpCiAKLW1rZGlyICR0bXBkaXIKIAogIyBJZiBwcmludGluZyBmcm9t
IHN0ZGluLCBzYXZlIGludG8gYSB0bXAgZmlsZQogaWYgdGVzdCAkZmlsZSA9ICctJzsgdGhlbgo=
</data>        

          </attachment>
    </bug>

</bugzilla>