1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[4.1.x] Fixed CVE-2022-41323 -- Prevented locales being interpreted as regular expressions.

Thanks to Benjamin Balder Bach for the report.
This commit is contained in:
Adam Johnson
2022-09-02 09:44:05 +01:00
committed by Carlton Gibson
parent 7843c43c49
commit 9d656ea51d
5 changed files with 23 additions and 3 deletions

View File

@@ -215,6 +215,12 @@ class URLTranslationTests(URLTestCaseBase):
expected_link,
)
def test_locale_not_interepreted_as_regex(self):
with translation.override("e("):
# Would previously error:
# re.error: missing ), unterminated subpattern at position 1
reverse("users")
class URLNamespaceTests(URLTestCaseBase):
"""