<?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>83920</bug_id>
          
          <creation_ts>2005-03-03 01:28 0000</creation_ts>
          <short_desc>wget-1.9.1-r3 breaks portage</short_desc>
          <delta_ts>2005-05-16 22:49:15 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Core system</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>fnevgeny@weizmann.ac.il</reporter>
          <assigned_to>seemant@gentoo.org</assigned_to>
          <cc>fnevgeny@weizmann.ac.il</cc>
    
    <cc>seemant@gentoo.org</cc>
    
    <cc>solar@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>fnevgeny@weizmann.ac.il</who>
            <bug_when>2005-03-03 01:28:39 0000</bug_when>
            <thetext>wget-CAN-2004-1487.patch breaks portage if DISTDIR begins with &quot;.&quot;. I use /.n/distfiles where &quot;/.n&quot; is an autofs root. As a result, wget saves files to /_n/distfiles/ instead and emerge fails. 

Reproducible: Always
Steps to Reproduce:</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>spookyghost@blueyonder.co.uk</who>
            <bug_when>2005-04-14 02:39:09 0000</bug_when>
            <thetext>wget seems to be mangling names that contain a sequence &quot;..&quot; to &quot;__&quot;.  If I get a file that is xxx..ogg then this becomes xxx__ogg, xxx...ogg =&gt; xxx__.ogg, xxx....ogg =&gt; xxx____ogg.

If I extract the original wget src and use the command line ./configure &amp;&amp; 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 &quot;/../&quot; not &quot;..&quot; etc.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>seemant@gentoo.org</who>
            <bug_when>2005-05-11 05:11:15 0000</bug_when>
            <thetext>solar thoughts?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>solar@gentoo.org</who>
            <bug_when>2005-05-11 09:55:27 0000</bug_when>
            <thetext>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&apos;t revert sanitize_path()</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>seemant@gentoo.org</who>
            <bug_when>2005-05-16 07:26:53 0000</bug_when>
            <thetext>listen, has -r4 fixed your issues with this?  there was a name-mangling patch from mandrake that I had added to it.

please report.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>fnevgeny@weizmann.ac.il</who>
            <bug_when>2005-05-16 07:50:33 0000</bug_when>
            <thetext>&gt; has -r4 fixed your issues with this?

Nope, all the same.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>fnevgeny@weizmann.ac.il</who>
            <bug_when>2005-05-16 07:58:22 0000</bug_when>
            <thetext>BTW, please restore at least one unbroken ebuild in the portage tree until the bug isn&apos;t fixed!!</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>seemant@gentoo.org</who>
            <bug_when>2005-05-16 08:05:01 0000</bug_when>
            <thetext>you know -- until upstream releases an update to wget that fixes that can 2004-1487 vulnerability (so that distros don&apos;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.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>seemant@gentoo.org</who>
            <bug_when>2005-05-16 08:05:33 0000</bug_when>
            <thetext>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.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>fnevgeny@weizmann.ac.il</who>
            <bug_when>2005-05-16 08:44:29 0000</bug_when>
            <thetext>&gt; I cannot restore a security vulnerable version into portage

Pardon me? The &quot;fix&quot; 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.

&gt; 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&apos;s version? http://ftp.debian.org/debian/pool/main/w/wget/wget_1.9.1-11.diff.gz</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>seemant@gentoo.org</who>
            <bug_when>2005-05-16 11:53:51 0000</bug_when>
            <thetext>the debian patch looks good to at least solar and me -- so stand by for an -r5</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>seemant@gentoo.org</who>
            <bug_when>2005-05-16 11:56:28 0000</bug_when>
            <thetext>sending this to security@ while I get the new version into portage.  GLSA needed, guys?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2005-05-16 13:18:57 0000</bug_when>
            <thetext>thx for the notification, but it doesn&apos;t seem exploitable so back to you seemant.

[22:16:10] &lt;@taviso&gt; i cant think of any attack vector, just an annoying bug</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>seemant@gentoo.org</who>
            <bug_when>2005-05-16 14:02:00 0000</bug_when>
            <thetext>well, -r5 is in portage, and has gotten stable on most architectures as well. thanks for the bug.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>fnevgeny@weizmann.ac.il</who>
            <bug_when>2005-05-16 22:49:15 0000</bug_when>
            <thetext>-r5 works fine. Thanks!</thetext>
          </long_desc>
      
    </bug>

</bugzilla>