RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 833831 - When redirected, wget should use the original page name for saving
Summary: When redirected, wget should use the original page name for saving
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: wget
Version: 6.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Tomáš Hozza
QA Contact: Jan Kepler
URL:
Whiteboard:
Depends On:
Blocks: CVE-2010-2252
TreeView+ depends on / blocked
 
Reported: 2012-06-20 12:54 UTC by Petr Šplíchal
Modified: 2022-07-09 06:18 UTC (History)
5 users (show)

Fixed In Version: wget-1.12-1.11.el6_5
Doc Type: Release Note
Doc Text:
Cause: Consequence: Fix: Result:
Clone Of:
Environment:
Last Closed: 2014-02-10 17:29:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
[PATCH] Introduce --trust-server-names option (6.14 KB, patch)
2012-11-20 11:54 UTC, Tomáš Hozza
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2014:0151 0 normal SHIPPED_LIVE Low: wget security and bug fix update 2014-02-10 22:29:11 UTC

Description Petr Šplíchal 2012-06-20 12:54:24 UTC
Description of problem:

When wget fetches a page which is redirected to another page it
uses the redirected page name for file creation which could be
something user is not expecting and could probably present a
security issue. This is correctly fixed in latest wget in RHEL7.

Version-Release number of selected component (if applicable):
wget-1.12-1.4.el6.x86_64

Steps to Reproduce:
1. Set up some redirection on the server
2. wget the redirected page
  
Actual results:

For example:
wget --max-redirect=40 http://localhost/wget/redir/00.html

--2012-06-20 16:39:28--  http://localhost/wget/redir/00.html
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://localhost/wget/redir/01.html [following]
--2012-06-20 16:39:28--  http://localhost/wget/redir/01.html
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://localhost/wget/redir/02.html [following]
--2012-06-20 16:39:28--  http://localhost/wget/redir/02.html
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://localhost/wget/redir/03.html [following]
--2012-06-20 16:39:28--  http://localhost/wget/redir/03.html
...
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://localhost/wget/redir/28.html [following]
--2012-06-20 16:39:28--  http://localhost/wget/redir/28.html
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://localhost/wget/redir/29.html [following]
--2012-06-20 16:39:28--  http://localhost/wget/redir/29.html
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://localhost/wget/redir/30.html [following]
--2012-06-20 16:39:28--  http://localhost/wget/redir/30.html
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15 [text/html]
Saving to: `30.html'

Expected results:
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15 [text/html]
Saving to: `00.html'

Comment 1 RHEL Program Management 2012-07-10 08:29:45 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 2 RHEL Program Management 2012-07-11 02:04:01 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 3 RHEL Program Management 2012-09-07 05:34:00 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 7 Tomáš Hozza 2012-11-20 11:54:48 UTC
Created attachment 648415 [details]
[PATCH] Introduce --trust-server-names option

Comment 8 Tomáš Hozza 2012-11-20 11:57:31 UTC
Wget WITHOUT patch:
$ ./wget http://localhost/wget/00.php
--2012-11-20 12:45:40--  http://localhost/wget/00.php
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://localhost/wget/01.php [following]
--2012-11-20 12:45:40--  http://localhost/wget/01.php
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://localhost/wget/02.php [following]
--2012-11-20 12:45:40--  http://localhost/wget/02.php
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://localhost/wget/03.php [following]
--2012-11-20 12:45:40--  http://localhost/wget/03.php
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://localhost/index.html [following]
--2012-11-20 12:45:40--  http://localhost/index.html
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 127 [text/html]
Saving to: `index.html'

100%[==============================================================>] 127         --.-K/s   in 0s      

2012-11-20 12:45:40 (7.76 MB/s) - `index.html' saved [127/127]



Wget WITH patch:
$ ./wget http://localhost/wget/00.php
--2012-11-20 12:51:20--  http://localhost/wget/00.php
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://localhost/wget/01.php [following]
--2012-11-20 12:51:20--  http://localhost/wget/01.php
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://localhost/wget/02.php [following]
--2012-11-20 12:51:20--  http://localhost/wget/02.php
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://localhost/wget/03.php [following]
--2012-11-20 12:51:20--  http://localhost/wget/03.php
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://localhost/index.html [following]
--2012-11-20 12:51:20--  http://localhost/index.html
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 127 [text/html]
Saving to: `00.php'

100%[==============================================================>] 127         --.-K/s   in 0s      

2012-11-20 12:51:20 (6.52 MB/s) - `00.php' saved [127/127]


$ ./wget --trust-server-names http://localhost/wget/00.php
--2012-11-20 12:51:38--  http://localhost/wget/00.php
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://localhost/wget/01.php [following]
--2012-11-20 12:51:38--  http://localhost/wget/01.php
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://localhost/wget/02.php [following]
--2012-11-20 12:51:38--  http://localhost/wget/02.php
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://localhost/wget/03.php [following]
--2012-11-20 12:51:38--  http://localhost/wget/03.php
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://localhost/index.html [following]
--2012-11-20 12:51:38--  http://localhost/index.html
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 127 [text/html]
Saving to: `index.html'

100%[==============================================================>] 127         --.-K/s   in 0s      

2012-11-20 12:51:38 (8.27 MB/s) - `index.html' saved [127/127]

Comment 9 RHEL Program Management 2013-10-14 00:35:45 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 11 Vasiliy Glazov 2014-01-31 07:34:59 UTC
Same problem when using wget for downloading archives from github.
For example:
wget http://github.com/LibreCAD/LibreCAD/archive/2.0.2.tar.gz

--2014-01-31 11:31:28--  http://github.com/LibreCAD/LibreCAD/archive/2.0.2.tar.gz
Resolving github.com... 192.30.252.130
Connecting to github.com|192.30.252.130|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://github.com/LibreCAD/LibreCAD/archive/2.0.2.tar.gz [following]
--2014-01-31 11:31:34--  https://github.com/LibreCAD/LibreCAD/archive/2.0.2.tar.gz
Connecting to github.com|192.30.252.130|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/LibreCAD/LibreCAD/tar.gz/2.0.2 [following]
--2014-01-31 11:31:34--  https://codeload.github.com/LibreCAD/LibreCAD/tar.gz/2.0.2
Resolving codeload.github.com... 192.30.252.146
Connecting to codeload.github.com|192.30.252.146|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15429871 (15M) [application/x-gzip]
Saving to: “2.0.2”

2014-01-31 11:32:17 (414 KB/s) - “2.0.2” saved [15429871/15429871]

But file must be saved as 2.0.2.tar.gz

And same problem when github archive uses as Source0 in rpm package for RHEL6.

Please, update wget.

Comment 17 errata-xmlrpc 2014-02-10 17:29:57 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2014-0151.html


Note You need to log in before you can comment on or make changes to this bug.