Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 88836 - mail-client/pine: Pine rpdump File Creation Race Condition
Summary: mail-client/pine: Pine rpdump File Creation Race Condition
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All All
: High minor (vote)
Assignee: Gentoo Security
URL: http://secunia.com/advisories/14899/
Whiteboard: B4 [noglsa] jaervosz
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-12 05:22 UTC by Luke Macken (RETIRED)
Modified: 2005-05-10 07:52 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Macken (RETIRED) gentoo-dev 2005-04-12 05:22:11 UTC
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
Comment 1 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2005-04-12 07:22:26 UTC
net-mail please advise.
Comment 2 Andrej Kacian (RETIRED) gentoo-dev 2005-04-12 16:35:09 UTC
Upstream hasn't provided a patch yet, I will mail Eduardo Chappa (probably most active one there) and ask about it.
Comment 3 Andrej Kacian (RETIRED) gentoo-dev 2005-04-13 08:10:04 UTC
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'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't know how a call to "access"
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'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's too long).
[/quote]
Comment 4 Thierry Carrez (RETIRED) gentoo-dev 2005-04-21 01:06:17 UTC
I tend to agree with the author this is not a serious thing, as almost all race conditions discovered by Imran are...
Comment 5 Matthias Geerdsen (RETIRED) gentoo-dev 2005-04-22 13:08:13 UTC
CAN-2005-1066
Comment 6 Andrej Kacian (RETIRED) gentoo-dev 2005-05-05 16:32:33 UTC
Ok, upstream has released 4.63 (few days ago, I failed to notice), which has this fixed (according to release notes). I've just committed an pine-4.63.ebuild to portage.
Comment 7 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2005-05-05 22:20:24 UTC
Thx Ticho.

Arches please test and mark stable.

Downgrading severity.
Comment 8 Andrej Kacian (RETIRED) gentoo-dev 2005-05-06 00:18:16 UTC
Stable on x86.
Comment 9 Andrej Kacian (RETIRED) gentoo-dev 2005-05-06 00:19:40 UTC
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) ['app-crypt/mit-krb5']
   mail-client/pine/pine-4.62-r1.ebuild: ~ppc-macos(default-darwin/macos/10.3) ['app-crypt/mit-krb5']
   mail-client/pine/pine-4.62.ebuild: ~ppc-macos(default-darwin/macos/10.3) ['app-crypt/mit-krb5']
   mail-client/pine/pine-4.61-r4.ebuild: ppc-macos(default-darwin/macos/10.3) ['app-crypt/mit-krb5']
   mail-client/pine/pine-4.61-r3.ebuild: ppc-macos(default-darwin/macos/10.3) ['app-crypt/mit-krb5']
   mail-client/pine/pine-4.62-r2.ebuild: ~ppc-macos(default-darwin/macos/10.3) ['app-crypt/mit-krb5']
   mail-client/pine/pine-4.63.ebuild: ~ppc-macos(default-darwin/macos/10.3) ['app-crypt/mit-krb5']
   mail-client/pine/pine-4.61-r5.ebuild: ppc-macos(default-darwin/macos/10.3) ['app-crypt/mit-krb5']
Comment 10 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-05-06 00:37:01 UTC
Stable on ppc.
Comment 11 Gustavo Zacarias (RETIRED) gentoo-dev 2005-05-06 07:00:14 UTC
sparc stable.
Comment 12 Bryan Østergaard (RETIRED) gentoo-dev 2005-05-06 15:22:22 UTC
Stable on alpha + ia64.
Comment 13 Herbie Hopkins (RETIRED) gentoo-dev 2005-05-06 15:51:07 UTC
Stable on amd64.
Comment 14 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2005-05-09 23:20:15 UTC
This one is ready for GLSA vote. I tend to vote NO.
Comment 15 Tavis Ormandy (RETIRED) gentoo-dev 2005-05-10 00:59:03 UTC
I would agree, NO glsa for this questionable issue.
Comment 16 Andrej Kacian (RETIRED) gentoo-dev 2005-05-10 02:20:58 UTC
Yup, this is a very minor issue. NO glsa, if you need one more vote. :)
Comment 17 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2005-05-10 07:52:27 UTC
Changing to a full NO -> closing without GLSA.