Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 83920 - wget-1.9.1-r3 breaks portage
Summary: wget-1.9.1-r3 breaks portage
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Seemant Kulleen (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-03 01:28 UTC by Evgeny Stambulchik
Modified: 2005-05-16 22:49 UTC (History)
3 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 Evgeny Stambulchik 2005-03-03 01:28:39 UTC
wget-CAN-2004-1487.patch breaks portage if DISTDIR begins with ".". I use /.n/distfiles where "/.n" is an autofs root. As a result, wget saves files to /_n/distfiles/ instead and emerge fails. 

Reproducible: Always
Steps to Reproduce:
Comment 1 Spooky Ghost 2005-04-14 02:39:09 UTC
wget seems to be mangling names that contain a sequence ".." to "__".  If I get a file that is xxx..ogg then this becomes xxx__ogg, xxx...ogg => xxx__.ogg, xxx....ogg => xxx____ogg.

If I extract the original wget src and use the command line ./configure && make the resulting wget binary does not have this problem.  Modifying the current ebuild and commenting all the epatch lines results in a wget program that will not fetch from http:// urls (others untested).  Adding them back one at a time:

ipvmisc.patch: OK
uclibc.patch: OK
locale.patch: OK
CAN-2004-1487.patch: broken

It looks like the sanitize_path function that is used to prevent undesirable directory traversal is incorrect, it should probably be matching "/../" not ".." etc.
Comment 2 Seemant Kulleen (RETIRED) gentoo-dev 2005-05-11 05:11:15 UTC
solar thoughts?
Comment 3 solar (RETIRED) gentoo-dev 2005-05-11 09:55:27 UTC
Ramndom thoughts per request..

1) get used to the new behavior.
2) contact upstream about a better fix for the sanitize_path() function.
3) allow user todo his own patching for /../ behavior (which may not be right)
4) see if any other distros have encounted this and what are they doing.
5) don't revert sanitize_path()
Comment 4 Seemant Kulleen (RETIRED) gentoo-dev 2005-05-16 07:26:53 UTC
listen, has -r4 fixed your issues with this?  there was a name-mangling patch from mandrake that I had added to it.

please report.
Comment 5 Evgeny Stambulchik 2005-05-16 07:50:33 UTC
> has -r4 fixed your issues with this?

Nope, all the same.
Comment 6 Evgeny Stambulchik 2005-05-16 07:58:22 UTC
BTW, please restore at least one unbroken ebuild in the portage tree until the bug isn't fixed!!
Comment 7 Seemant Kulleen (RETIRED) gentoo-dev 2005-05-16 08:05:01 UTC
you know -- until upstream releases an update to wget that fixes that can 2004-1487 vulnerability (so that distros don't have to patch it) then we can take it up with them.  Until then, your best bet is to patch wget yourself -- or get me a patch to add.  Thanks.
Comment 8 Seemant Kulleen (RETIRED) gentoo-dev 2005-05-16 08:05:33 UTC
I cannot restore a security vulnerable version into portage, but you are welcome to download older ebuilds from the viewcvs page off www.gentoo.org.
Comment 9 Evgeny Stambulchik 2005-05-16 08:44:29 UTC
> I cannot restore a security vulnerable version into portage

Pardon me? The "fix" which is included in -r3 and -r4 is a security hole by itself, since it results in unwanted directory creation right in the root filesystem. And CAN-2004-1488 is still unpatched (which by all means is more actual than CAN-2004-1487). See http://www.mail-archive.com/wget@sunsite.dk/msg07480.html.

> or get me a patch to add.

Spooky Ghost (comment #1) has correctly suggested what needs to be changed in the patch. How about Debian's version? http://ftp.debian.org/debian/pool/main/w/wget/wget_1.9.1-11.diff.gz
Comment 10 Seemant Kulleen (RETIRED) gentoo-dev 2005-05-16 11:53:51 UTC
the debian patch looks good to at least solar and me -- so stand by for an -r5
Comment 11 Seemant Kulleen (RETIRED) gentoo-dev 2005-05-16 11:56:28 UTC
sending this to security@ while I get the new version into portage.  GLSA needed, guys?
Comment 12 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2005-05-16 13:18:57 UTC
thx for the notification, but it doesn't seem exploitable so back to you seemant.

[22:16:10] <@taviso> i cant think of any attack vector, just an annoying bug
Comment 13 Seemant Kulleen (RETIRED) gentoo-dev 2005-05-16 14:02:00 UTC
well, -r5 is in portage, and has gotten stable on most architectures as well. thanks for the bug.
Comment 14 Evgeny Stambulchik 2005-05-16 22:49:15 UTC
-r5 works fine. Thanks!