2019年8月1日
Django 1.11.23修复了1.11.22中的安全问题。
django.utils.text.Truncator
¶如果 django.utils.text.Truncator
的 chars()
和 words()
方法已通过 html=True
理由是,由于正则表达式中存在灾难性的回溯漏洞,它们在评估某些输入时非常慢。这个 chars()
和 words()
方法用于实现 truncatechars_html
和 truncatewords_html
模板过滤器,因此容易受到攻击。
使用的正则表达式 Truncator
已简化,以避免潜在的回溯问题。因此,尾随标点符号有时可能包含在截断的输出中。
JSONField
/HStoreField
¶Key and index lookups
为 django.contrib.postgres.fields.JSONField
和 key lookups
为 HStoreField
都受到SQL注入的影响,使用适当构造的字典,并进行字典扩展,因为 **kwargs
已传递给 QuerySet.filter()
。
django.utils.encoding.uri_to_iri()
¶如果通过某些输入, django.utils.encoding.uri_to_iri()
当对无效的UTF-8八位字节序列重新编码时,由于过度递归,可能会导致大量内存使用。
uri_to_iri()
现在避免了对无效的UTF-8八位字节序列进行重新编码时的递归。
12月 18, 2023