Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
bf650a2e
Kaydet (Commit)
bf650a2e
authored
Tem 17, 2014
tarafından
Florian Apolloner
Kaydeden (comit)
Tim Graham
Agu 20, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[1.7.x] Prevented reverse() from generating URLs pointing to other hosts.
This is a security fix. Disclosure following shortly.
üst
1c00c38b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
1 deletion
+50
-1
urlresolvers.py
django/core/urlresolvers.py
+5
-1
1.4.14.txt
docs/releases/1.4.14.txt
+13
-0
1.5.9.txt
docs/releases/1.5.9.txt
+13
-0
1.6.6.txt
docs/releases/1.6.6.txt
+13
-0
tests.py
tests/urlpatterns_reverse/tests.py
+3
-0
urls.py
tests/urlpatterns_reverse/urls.py
+3
-0
No files found.
django/core/urlresolvers.py
Dosyayı görüntüle @
bf650a2e
...
...
@@ -442,7 +442,11 @@ class RegexURLResolver(LocaleRegexProvider):
candidate_pat
=
prefix_norm
.
replace
(
'
%
'
,
'
%%
'
)
+
result
if
re
.
search
(
'^
%
s
%
s'
%
(
prefix_norm
,
pattern
),
candidate_pat
%
candidate_subs
,
re
.
UNICODE
):
candidate_subs
=
dict
((
k
,
urlquote
(
v
))
for
(
k
,
v
)
in
candidate_subs
.
items
())
return
candidate_pat
%
candidate_subs
url
=
candidate_pat
%
candidate_subs
# Don't allow construction of scheme relative urls.
if
url
.
startswith
(
'//'
):
url
=
'/
%%2
F
%
s'
%
url
[
2
:]
return
url
# 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
# error messages.
...
...
docs/releases/1.4.14.txt
Dosyayı görüntüle @
bf650a2e
...
...
@@ -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.
docs/releases/1.5.9.txt
Dosyayı görüntüle @
bf650a2e
...
...
@@ -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.
docs/releases/1.6.6.txt
Dosyayı görüntüle @
bf650a2e
...
...
@@ -6,6 +6,19 @@ Django 1.6.6 release notes
Django 1.6.6 fixes several security issues and bugs in 1.6.5.
: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.
Bugfixes
========
...
...
tests/urlpatterns_reverse/tests.py
Dosyayı görüntüle @
bf650a2e
...
...
@@ -151,6 +151,9 @@ test_data = (
(
'defaults'
,
'/defaults_view2/3/'
,
[],
{
'arg1'
:
3
,
'arg2'
:
2
}),
(
'defaults'
,
NoReverseMatch
,
[],
{
'arg1'
:
3
,
'arg2'
:
3
}),
(
'defaults'
,
NoReverseMatch
,
[],
{
'arg2'
:
1
}),
# Security tests
(
'security'
,
'/
%2
Fexample.com/security/'
,
[
'/example.com'
],
{}),
)
...
...
tests/urlpatterns_reverse/urls.py
Dosyayı görüntüle @
bf650a2e
...
...
@@ -66,4 +66,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'
),
)
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