Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
83e4a1df
Commit
83e4a1df
authored
Mar 24, 2011
by
guido
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add FTP to the allowed url schemes. Add Misc/NEWS.
parent
96ec281e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
Lib/urllib.py
Lib/urllib.py
+3
-2
Lib/urllib2.py
Lib/urllib2.py
+3
-2
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/urllib.py
View file @
83e4a1df
...
...
@@ -643,10 +643,11 @@ class FancyURLopener(URLopener):
newurl
=
basejoin
(
self
.
type
+
":"
+
url
,
newurl
)
# For security reasons we do not allow redirects to protocols
# other than HTTP
or HTTPS
.
# other than HTTP
, HTTPS or FTP
.
newurl_lower
=
newurl
.
lower
()
if
not
(
newurl_lower
.
startswith
(
'http://'
)
or
newurl_lower
.
startswith
(
'https://'
)):
newurl_lower
.
startswith
(
'https://'
)
or
newurl_lower
.
startswith
(
'ftp://'
)):
return
void
=
fp
.
read
()
...
...
Lib/urllib2.py
View file @
83e4a1df
...
...
@@ -556,10 +556,11 @@ class HTTPRedirectHandler(BaseHandler):
newurl = urlparse.urljoin(req.get_full_url(), newurl)
# For security reasons we do not allow redirects to protocols
# other than HTTP
or HTTPS
.
# other than HTTP
, HTTPS or FTP
.
newurl_lower = newurl.lower()
if not (newurl_lower.startswith('http://') or
newurl_lower.startswith('https://')):
newurl_lower.startswith('https://') or
newurl_lower.startswith('ftp://')):
return
# XXX Probably want to forget about the state of the current
...
...
Misc/NEWS
View file @
83e4a1df
...
...
@@ -12,6 +12,9 @@ What's New in Python 2.5.6c1?
Library
-------
- Issue #11662: Make urllib and urllib2 ignore redirections if the
scheme is not HTTP, HTTPS or FTP. This fixes a security hole.
- Issue #8674: Fixed a number of incorrect or undefined-behaviour-inducing
overflow checks in the audioop module (CVE-2010-1634).
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment