Ticket #17460: hidden_settingsv2.patch
File hidden_settingsv2.patch, 1.7 KB (added by , 13 years ago) |
---|
-
docs/ref/settings.txt
758 758 759 759 If you define custom settings, `django/views/debug.py`_ has a ``HIDDEN_SETTINGS`` 760 760 regular expression which will hide from the DEBUG view anything that contains 761 ``'SECRET'``, ``'PASSWORD'``, ``'PROFANITIES'``, or ``'SIGNATURE'``. This allows 762 untrusted users to be able to give backtraces without seeing sensitive (or 763 offensive) settings. 761 ``'API'``, ``'TOKEN'``, ``'KEY'``, ``'SECRET'``, ``'PASS'``, ``'PROFANITIES'``, 762 or ``'SIGNATURE'``. 763 This allows untrusted users to be able to give backtraces without seeing 764 sensitive (or offensive) settings. 764 765 766 Note that due to how regular expression matching works ``'PASS'`` will also 767 match PASSWORD, just as ``'TOKEN'`` will also match TOKENIZED and so on. 768 765 769 Still, note that there are always going to be sections of your debug output that 766 770 are inappropriate for public consumption. File paths, configuration options, and 767 771 the like all give attackers extra information about your server. -
django/views/debug.py
14 14 from django.utils.importlib import import_module 15 15 from django.utils.encoding import smart_unicode, smart_str 16 16 17 HIDDEN_SETTINGS = re.compile(' SECRET|PASSWORD|PROFANITIES_LIST|SIGNATURE')17 HIDDEN_SETTINGS = re.compile('API|TOKEN|KEY|SECRET|PASS|PROFANITIES_LIST|SIGNATURE') 18 18 19 19 CLEANSED_SUBSTITUTE = u'********************'