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
97b7dd59
Kaydet (Commit)
97b7dd59
authored
Şub 24, 2018
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed CVE-2018-7537 -- Fixed catastrophic backtracking in django.utils.text.Truncator.
Thanks James Davis for suggesting the fix.
üst
8618271c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
1 deletion
+41
-1
text.py
django/utils/text.py
+1
-1
1.11.11.txt
docs/releases/1.11.11.txt
+12
-0
1.8.19.txt
docs/releases/1.8.19.txt
+12
-0
2.0.3.txt
docs/releases/2.0.3.txt
+12
-0
test_text.py
tests/utils_tests/test_text.py
+4
-0
No files found.
django/utils/text.py
Dosyayı görüntüle @
97b7dd59
...
...
@@ -20,7 +20,7 @@ def capfirst(x):
# Set up regular expressions
re_words
=
re
.
compile
(
r'<.*?>|((?:\w[-\w]*|&.*?;)+)'
,
re
.
S
)
re_chars
=
re
.
compile
(
r'<.*?>|(.)'
,
re
.
S
)
re_tag
=
re
.
compile
(
r'<(/)?(
[^ ]+?)(?:(\s*/)|
.*?)?>'
,
re
.
S
)
re_tag
=
re
.
compile
(
r'<(/)?(
\S+?)(?:(\s*/)|\s
.*?)?>'
,
re
.
S
)
re_newlines
=
re
.
compile
(
r'\r\n|\r'
)
# Used in normalize_newlines
re_camel_case
=
re
.
compile
(
r'(((?<=[a-z])[A-Z])|([A-Z](?![A-Z]|$)))'
)
...
...
docs/releases/1.11.11.txt
Dosyayı görüntüle @
97b7dd59
...
...
@@ -16,3 +16,15 @@ expressions. The ``urlize()`` function is used to implement the ``urlize`` and
The problematic regular expressions are replaced with parsing logic that
behaves similarly.
CVE-2018-7537: Denial-of-service possibility in ``truncatechars_html`` and ``truncatewords_html`` template filters
==================================================================================================================
If ``django.utils.text.Truncator``'s ``chars()`` and ``words()`` methods were
passed the ``html=True`` argument, they were extremely slow to evaluate certain
inputs due to a catastrophic backtracking vulnerability in a regular
expression. The ``chars()`` and ``words()`` methods are used to implement the
``truncatechars_html`` and ``truncatewords_html`` template filters, which were
thus vulnerable.
The backtracking problem in the regular expression is fixed.
docs/releases/1.8.19.txt
Dosyayı görüntüle @
97b7dd59
...
...
@@ -16,3 +16,15 @@ expression. The ``urlize()`` function is used to implement the ``urlize`` and
The problematic regular expression is replaced with parsing logic that behaves
similarly.
CVE-2018-7537: Denial-of-service possibility in ``truncatechars_html`` and ``truncatewords_html`` template filters
==================================================================================================================
If ``django.utils.text.Truncator``'s ``chars()`` and ``words()`` methods were
passed the ``html=True`` argument, they were extremely slow to evaluate certain
inputs due to a catastrophic backtracking vulnerability in a regular
expression. The ``chars()`` and ``words()`` methods are used to implement the
``truncatechars_html`` and ``truncatewords_html`` template filters, which were
thus vulnerable.
The backtracking problem in the regular expression is fixed.
docs/releases/2.0.3.txt
Dosyayı görüntüle @
97b7dd59
...
...
@@ -18,6 +18,18 @@ expressions. The ``urlize()`` function is used to implement the ``urlize`` and
The problematic regular expressions are replaced with parsing logic that
behaves similarly.
CVE-2018-7537: Denial-of-service possibility in ``truncatechars_html`` and ``truncatewords_html`` template filters
==================================================================================================================
If ``django.utils.text.Truncator``'s ``chars()`` and ``words()`` methods were
passed the ``html=True`` argument, they were extremely slow to evaluate certain
inputs due to a catastrophic backtracking vulnerability in a regular
expression. The ``chars()`` and ``words()`` methods are used to implement the
``truncatechars_html`` and ``truncatewords_html`` template filters, which were
thus vulnerable.
The backtracking problem in the regular expression is fixed.
Bugfixes
========
...
...
tests/utils_tests/test_text.py
Dosyayı görüntüle @
97b7dd59
...
...
@@ -136,6 +136,10 @@ class TestUtilsText(SimpleTestCase):
truncator
=
text
.
Truncator
(
'<p>I <3 python, what about you?</p>'
)
self
.
assertEqual
(
'<p>I <3 python...</p>'
,
truncator
.
words
(
3
,
'...'
,
html
=
True
))
re_tag_catastrophic_test
=
(
'</a'
+
'
\t
'
*
50000
)
+
'//>'
truncator
=
text
.
Truncator
(
re_tag_catastrophic_test
)
self
.
assertEqual
(
re_tag_catastrophic_test
,
truncator
.
words
(
500
,
html
=
True
))
def
test_wrap
(
self
):
digits
=
'1234 67 9'
self
.
assertEqual
(
text
.
wrap
(
digits
,
100
),
'1234 67 9'
)
...
...
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