Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 926623 Details for
Bug 1129950
CVE-2014-0480 Django: reverse() can generate URLs pointing to other hosts, leading to phishing attacks
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
1.5 patch
reverse-1.5.diff (text/plain), 4.20 KB, created by
Murray McAllister
on 2014-08-14 04:39:53 UTC
(
hide
)
Description:
1.5 patch
Filename:
MIME Type:
Creator:
Murray McAllister
Created:
2014-08-14 04:39:53 UTC
Size:
4.20 KB
patch
obsolete
>commit 722a7959c70bbcb056f9185a84e0b358f1e04774 >Author: Florian Apolloner <florian@apolloner.eu> >Date: Thu Jul 17 21:59:28 2014 +0200 > > [1.5.x] Prevented reverse() from generating URLs pointing to other hosts. > > This is a security fix. Disclosure following shortly. > >diff --git a/django/core/urlresolvers.py b/django/core/urlresolvers.py >index 3e314e2..aab2cf6 100644 >--- a/django/core/urlresolvers.py >+++ b/django/core/urlresolvers.py >@@ -426,6 +426,8 @@ class RegexURLResolver(LocaleRegexProvider): > unicode_kwargs = dict([(k, force_text(v)) for (k, v) in kwargs.items()]) > candidate = (prefix_norm.replace('%', '%%') + result) % unicode_kwargs > if re.search('^%s%s' % (prefix_norm, pattern), candidate, re.UNICODE): >+ if candidate.startswith('//'): >+ candidate = '/%%2F%s' % candidate[2:] > return candidate > # lookup_view can be URL label, or dotted path, or callable, Any of > # these can be passed in at the top, but callables are not friendly in >diff --git a/docs/releases/1.4.14.txt b/docs/releases/1.4.14.txt >index d0032e5..28390c9 100644 >--- a/docs/releases/1.4.14.txt >+++ b/docs/releases/1.4.14.txt >@@ -5,3 +5,16 @@ Django 1.4.14 release notes > *Under development* > > Django 1.4.14 fixes several security issues in 1.4.13. >+ >+:func:`~django.core.urlresolvers.reverse()` could generate URLs pointing to other hosts >+======================================================================================= >+ >+In certain situations, URL reversing could generate scheme-relative URLs (URLs >+starting with two slashes), which could unexpectedly redirect a user to a >+different host. An attacker could exploit this, for example, by redirecting >+users to a phishing site designed to ask for user's passwords. >+ >+To remedy this, URL reversing now ensures that no URL starts with two slashes >+(//), replacing the second slash with its URL encoded counterpart (%2F). This >+approach ensures that semantics stay the same, while making the URL relative to >+the domain and not to the scheme. >diff --git a/docs/releases/1.5.9.txt b/docs/releases/1.5.9.txt >index 4a5233a..12b5b5f 100644 >--- a/docs/releases/1.5.9.txt >+++ b/docs/releases/1.5.9.txt >@@ -5,3 +5,16 @@ Django 1.5.9 release notes > *Under development* > > Django 1.5.9 fixes several security issues in 1.5.8. >+ >+:func:`~django.core.urlresolvers.reverse()` could generate URLs pointing to other hosts >+======================================================================================= >+ >+In certain situations, URL reversing could generate scheme-relative URLs (URLs >+starting with two slashes), which could unexpectedly redirect a user to a >+different host. An attacker could exploit this, for example, by redirecting >+users to a phishing site designed to ask for user's passwords. >+ >+To remedy this, URL reversing now ensures that no URL starts with two slashes >+(//), replacing the second slash with its URL encoded counterpart (%2F). This >+approach ensures that semantics stay the same, while making the URL relative to >+the domain and not to the scheme. >diff --git a/tests/regressiontests/urlpatterns_reverse/tests.py b/tests/regressiontests/urlpatterns_reverse/tests.py >index e3e14b3..a7c8bcc 100644 >--- a/tests/regressiontests/urlpatterns_reverse/tests.py >+++ b/tests/regressiontests/urlpatterns_reverse/tests.py >@@ -143,6 +143,9 @@ test_data = ( > ('defaults', '/defaults_view2/3/', [], {'arg1': 3, 'arg2': 2}), > ('defaults', NoReverseMatch, [], {'arg1': 3, 'arg2': 3}), > ('defaults', NoReverseMatch, [], {'arg2': 1}), >+ >+ # Security tests >+ ('security', '/%2Fexample.com/security/', ['/example.com'], {}), > ) > > class NoURLPatternsTests(TestCase): >diff --git a/tests/regressiontests/urlpatterns_reverse/urls.py b/tests/regressiontests/urlpatterns_reverse/urls.py >index 7aae7c4..0d3f8c3 100644 >--- a/tests/regressiontests/urlpatterns_reverse/urls.py >+++ b/tests/regressiontests/urlpatterns_reverse/urls.py >@@ -71,4 +71,7 @@ urlpatterns = patterns('', > (r'defaults_view2/(?P<arg1>\d+)/', 'defaults_view', {'arg2': 2}, 'defaults'), > > url('^includes/', include(other_patterns)), >+ >+ # Security tests >+ url('(.+)/security/$', empty_view, name='security'), > )
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1129950
:
926622
| 926623 |
926625