Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 112061

Summary: app-portage/eix <= 0.3.0-r1 insecure tmp file handling
Product: Gentoo Security Reporter: Romang <zataz>
Component: VulnerabilitiesAssignee: Gentoo Security <security>
Severity: minor CC: hollow
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard: B3 [glsa]
Package list:
Runtime testing required: ---

Description Romang 2005-11-10 02:43:17 UTC

Take a look at src/ :

46 cp /var/cache/eix /tmp/eix.$$.sync || die "Error while copying cache-file to
a save location        ."
diff-eix /tmp/eix.$$.sync          || die "Error while diffing."

Comment 1 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2005-11-11 01:14:19 UTC
Auditors please confirm. 
Comment 2 Tavis Ormandy (RETIRED) gentoo-dev 2005-11-11 01:49:46 UTC
confirmed, but it's not a race condition, it's a second order insecure temporary 
file handling issue.
Comment 3 Thierry Carrez (RETIRED) gentoo-dev 2005-11-13 10:15:52 UTC
ccing maintainer.
Comment 4 Benedikt Böhm (RETIRED) gentoo-dev 2005-11-17 07:01:04 UTC
can someone explain what's the problem with this? 
Comment 5 Thierry Carrez (RETIRED) gentoo-dev 2005-11-17 07:20:54 UTC
A local attacker can watch the process list and determine what $$ is while the
"emerge --sync" part is running, then create a link at the corresponding tmpfile
to a system file, say /etc/passwd... and bring down the host.

The fact that this runs as root and may be part of a cron job makes things even

Doing a mktemp before the emerge --sync to safely create a random file that you
will use afterwards to hold your temporary contents would be much better.
Comment 6 Benedikt Böhm (RETIRED) gentoo-dev 2005-11-17 15:55:02 UTC
ok, it's fixed with 0.3.0-r2 and also in upstream svn for 0.5.0 
Comment 7 Thierry Carrez (RETIRED) gentoo-dev 2005-11-18 05:06:08 UTC
Thx Benedikt,

Arches please test 0.3.0-r2 and mark stable :
Target KEYWORDS="alpha amd64 ia64 ~mips ppc sparc x86"
Comment 8 Gustavo Zacarias (RETIRED) gentoo-dev 2005-11-18 05:56:21 UTC
sparc stable.
Comment 9 Andrej Kacian (RETIRED) gentoo-dev 2005-11-18 07:25:07 UTC
x86 happy
Comment 10 Luis Medinas (RETIRED) gentoo-dev 2005-11-18 17:24:37 UTC
stable on amd64
Comment 11 Fernando J. Pereda (RETIRED) gentoo-dev 2005-11-19 07:39:45 UTC

Comment 12 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-11-19 11:04:00 UTC
Stable on ppc.
Comment 13 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2005-11-20 04:15:15 UTC
This one is ready for GLSA decision. I vote YES. 
Comment 14 Thierry Carrez (RETIRED) gentoo-dev 2005-11-21 01:10:46 UTC
I vote yes too. This is easy to exploit, and can be run as root as part of
normal operations.
Comment 15 Thierry Carrez (RETIRED) gentoo-dev 2005-11-21 01:14:30 UTC
The ppc keyword was never applied, apparently.
Comment 16 Joe Jezak (RETIRED) gentoo-dev 2005-11-21 11:22:15 UTC
hansmi marked it ppc stable today, removing ppc.
Comment 17 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2005-11-22 14:48:52 UTC
GLSA 200511-19 
ia64 don't forget to mark stable to benifit from the GLSA.