<?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>88836</bug_id>
          
          <creation_ts>2005-04-12 05:22 0000</creation_ts>
          <short_desc>mail-client/pine: Pine rpdump File Creation Race Condition</short_desc>
          <delta_ts>2005-05-10 07:52:27 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/14899/</bug_file_loc>
          <status_whiteboard>B4 [noglsa] jaervosz</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>net-mail@gentoo.org</cc>
    
    <cc>ppc-macos@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>lewk@gentoo.org</who>
            <bug_when>2005-04-12 05:22:11 0000</bug_when>
            <thetext>TITLE:
Pine rpdump File Creation Race Condition Vulnerability

SECUNIA ADVISORY ID:
SA14899

VERIFY ADVISORY:
http://secunia.com/advisories/14899/

CRITICAL:
Not critical

IMPACT:
Manipulation of data

WHERE:
Local system

SOFTWARE:
Pine 4.x
http://secunia.com/product/710/

DESCRIPTION:
Imran Ghory has reported a vulnerability in Pine, which potentially
can be exploited by malicious, local users to perform certain actions
on a vulnerable system with escalated privileges.

The vulnerability is caused due to a race condition in the rpdump
utility when creating files. The problem is that there is a larger
gap between the time that a check is made to determine whether a
local file exists and the time that the file is created. This can be
exploited via symlink attacks to overwrite arbitrary files with the
privileges of the user running the vulnerable program.

Successful exploitation requires write permissions to the directory,
which rpdump creates the local file in.

The vulnerability has been reported in Pine 4.62. Other versions may
also be affected.

SOLUTION:
Ensure that only the user has write permissions to the directory used
for creating the file with rpdump.

PROVIDED AND/OR DISCOVERED BY:
Imran Ghory</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2005-04-12 07:22:26 0000</bug_when>
            <thetext>net-mail please advise.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ticho@gentoo.org</who>
            <bug_when>2005-04-12 16:35:09 0000</bug_when>
            <thetext>Upstream hasn&apos;t provided a patch yet, I will mail Eduardo Chappa (probably most active one there) and ask about it.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ticho@gentoo.org</who>
            <bug_when>2005-04-13 08:10:04 0000</bug_when>
            <thetext>Mr. Chappa informed me that Pine team is aware of this vulnerability, and is working on it. He also commented on the vulnerability (there was no disclaimer with his e-mail, so I guess it&apos;s alright to reproduce):

[quote]
  I saw the report and I took a look at the source code of rpdump, so I 
will tell you what I think.

  First off all, rpdump is a program that downloads remote configuration 
information of Pine to a local file. In another words, an attacker could 
be able to see a .pinerc file that a person is downloading. The attack 
requires that a user be able to write in someone elses directory, but in 
that case you can probably overwrite a .pinerc file, so the system is 
horribly configured. In my opinion this is not a big issue.

  The only information that you could gain by symlinking a .pinerc file is 
personal information about servers, no passwords can be obtained this way 
(unless the user writes explicitly in that file the passwords). I do not 
consider this information very interesting, unless one connects insecurely 
to those servers, in whose case it may be interesting for the attacker, 
but in that case, chances are that someone else already spied that 
connection and got the sensitive information necessary to connect to that 
server.

  By looking at the source code of rpdump, I see that pine checks for 
access to the local file that is going to be used to download such remote 
information, way before it creates such file, it does it even before it 
connects to the remote server. I myself don&apos;t know how a call to &quot;access&quot;
will alert an attacker to create a symlink to a non existing file, I guess 
one could see it from the processes table, but I really don&apos;t see how 
useful this attack is. However, if you know of a way to do this, then 
there is enough time to do this attack (in the sense that it could take a 
couple of seconds to complete this operations, rarely it should take more 
than 10 seconds, and that&apos;s too long).
[/quote]</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-04-21 01:06:17 0000</bug_when>
            <thetext>I tend to agree with the author this is not a serious thing, as almost all race conditions discovered by Imran are...</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vorlon@gentoo.org</who>
            <bug_when>2005-04-22 13:08:13 0000</bug_when>
            <thetext>CAN-2005-1066</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ticho@gentoo.org</who>
            <bug_when>2005-05-05 16:32:33 0000</bug_when>
            <thetext>Ok, upstream has released 4.63 (few days ago, I failed to notice), which has this fixed (according to release notes). I&apos;ve just committed an pine-4.63.ebuild to portage.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2005-05-05 22:20:24 0000</bug_when>
            <thetext>Thx Ticho.

Arches please test and mark stable.

Downgrading severity.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ticho@gentoo.org</who>
            <bug_when>2005-05-06 00:18:16 0000</bug_when>
            <thetext>Stable on x86.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ticho@gentoo.org</who>
            <bug_when>2005-05-06 00:19:40 0000</bug_when>
            <thetext>Oh, and ppc-macos should fix pine in regards to mit-krb5:

 RDEPEND.badindev               8
   mail-client/pine/pine-4.61-r2.ebuild: ppc-macos(default-darwin/macos/10.3) [&apos;app-crypt/mit-krb5&apos;]
   mail-client/pine/pine-4.62-r1.ebuild: ~ppc-macos(default-darwin/macos/10.3) [&apos;app-crypt/mit-krb5&apos;]
   mail-client/pine/pine-4.62.ebuild: ~ppc-macos(default-darwin/macos/10.3) [&apos;app-crypt/mit-krb5&apos;]
   mail-client/pine/pine-4.61-r4.ebuild: ppc-macos(default-darwin/macos/10.3) [&apos;app-crypt/mit-krb5&apos;]
   mail-client/pine/pine-4.61-r3.ebuild: ppc-macos(default-darwin/macos/10.3) [&apos;app-crypt/mit-krb5&apos;]
   mail-client/pine/pine-4.62-r2.ebuild: ~ppc-macos(default-darwin/macos/10.3) [&apos;app-crypt/mit-krb5&apos;]
   mail-client/pine/pine-4.63.ebuild: ~ppc-macos(default-darwin/macos/10.3) [&apos;app-crypt/mit-krb5&apos;]
   mail-client/pine/pine-4.61-r5.ebuild: ppc-macos(default-darwin/macos/10.3) [&apos;app-crypt/mit-krb5&apos;]
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>hansmi@gentoo.org</who>
            <bug_when>2005-05-06 00:37:01 0000</bug_when>
            <thetext>Stable on ppc.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gustavoz@gentoo.org</who>
            <bug_when>2005-05-06 07:00:14 0000</bug_when>
            <thetext>sparc stable.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kloeri@gentoo.org</who>
            <bug_when>2005-05-06 15:22:22 0000</bug_when>
            <thetext>Stable on alpha + ia64.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>herbs@gentoo.org</who>
            <bug_when>2005-05-06 15:51:07 0000</bug_when>
            <thetext>Stable on amd64.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2005-05-09 23:20:15 0000</bug_when>
            <thetext>This one is ready for GLSA vote. I tend to vote NO.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>taviso@gentoo.org</who>
            <bug_when>2005-05-10 00:59:03 0000</bug_when>
            <thetext>I would agree, NO glsa for this questionable issue.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ticho@gentoo.org</who>
            <bug_when>2005-05-10 02:20:58 0000</bug_when>
            <thetext>Yup, this is a very minor issue. NO glsa, if you need one more vote. :)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2005-05-10 07:52:27 0000</bug_when>
            <thetext>Changing to a full NO -&gt; closing without GLSA.</thetext>
          </long_desc>
      
    </bug>

</bugzilla>