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
316bc3fc
Kaydet (Commit)
316bc3fc
authored
Kas 11, 2015
tarafından
Florian Apolloner
Kaydeden (comit)
Tim Graham
Kas 24, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed a settings leak possibility in the date template filter.
This is a security fix.
üst
710e11d0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
2 deletions
+51
-2
formats.py
django/utils/formats.py
+20
-0
1.7.11.txt
docs/releases/1.7.11.txt
+14
-1
1.8.7.txt
docs/releases/1.8.7.txt
+14
-1
tests.py
tests/i18n/tests.py
+3
-0
No files found.
django/utils/formats.py
Dosyayı görüntüle @
316bc3fc
...
...
@@ -30,6 +30,24 @@ ISO_INPUT_FORMATS = {
}
FORMAT_SETTINGS
=
frozenset
([
'DECIMAL_SEPARATOR'
,
'THOUSAND_SEPARATOR'
,
'NUMBER_GROUPING'
,
'FIRST_DAY_OF_WEEK'
,
'MONTH_DAY_FORMAT'
,
'TIME_FORMAT'
,
'DATE_FORMAT'
,
'DATETIME_FORMAT'
,
'SHORT_DATE_FORMAT'
,
'SHORT_DATETIME_FORMAT'
,
'YEAR_MONTH_FORMAT'
,
'DATE_INPUT_FORMATS'
,
'TIME_INPUT_FORMATS'
,
'DATETIME_INPUT_FORMATS'
,
])
def
reset_format_cache
():
"""Clear any cached formats.
...
...
@@ -92,6 +110,8 @@ def get_format(format_type, lang=None, use_l10n=None):
be localized (or not), overriding the value of settings.USE_L10N.
"""
format_type
=
force_str
(
format_type
)
if
format_type
not
in
FORMAT_SETTINGS
:
return
format_type
if
use_l10n
or
(
use_l10n
is
None
and
settings
.
USE_L10N
):
if
lang
is
None
:
lang
=
get_language
()
...
...
docs/releases/1.7.11.txt
Dosyayı görüntüle @
316bc3fc
...
...
@@ -4,7 +4,20 @@ Django 1.7.11 release notes
*Under development*
Django 1.7.11 fixes a data loss bug in 1.7.10.
Django 1.7.11 fixes a security issue and a data loss bug in 1.7.10.
Fixed settings leak possibility in ``date`` template filter
===========================================================
If an application allows users to specify an unvalidated format for dates and
passes this format to the :tfilter:`date` filter, e.g.
``{{ last_updated|date:user_date_format }}``, then a malicious user could
obtain any secret in the application's settings by specifying a settings key
instead of a date format. e.g. ``"SECRET_KEY"`` instead of ``"j/m/Y"``.
To remedy this, the underlying function used by the ``date`` template filter,
``django.utils.formats.get_format()``, now only allows accessing the date/time
formatting settings.
Bugfixes
========
...
...
docs/releases/1.8.7.txt
Dosyayı görüntüle @
316bc3fc
...
...
@@ -4,11 +4,24 @@ Django 1.8.7 release notes
*Under development*
Django 1.8.7 fixes several bugs in 1.8.6.
Django 1.8.7 fixes
a security issue and
several bugs in 1.8.6.
Additionally, Django's vendored version of six, :mod:`django.utils.six`, has
been upgraded to the latest release (1.10.0).
Fixed settings leak possibility in ``date`` template filter
===========================================================
If an application allows users to specify an unvalidated format for dates and
passes this format to the :tfilter:`date` filter, e.g.
``{{ last_updated|date:user_date_format }}``, then a malicious user could
obtain any secret in the application's settings by specifying a settings key
instead of a date format. e.g. ``"SECRET_KEY"`` instead of ``"j/m/Y"``.
To remedy this, the underlying function used by the ``date`` template filter,
``django.utils.formats.get_format()``, now only allows accessing the date/time
formatting settings.
Bugfixes
========
...
...
tests/i18n/tests.py
Dosyayı görüntüle @
316bc3fc
...
...
@@ -1249,6 +1249,9 @@ class FormattingTests(SimpleTestCase):
'<input id="id_cents_paid" name="cents_paid" type="hidden" value="59,47" />'
)
def
test_format_arbitrary_settings
(
self
):
self
.
assertEqual
(
get_format
(
'DEBUG'
),
'DEBUG'
)
class
MiscTests
(
SimpleTestCase
):
...
...
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