summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAdam Johnson <me@adamj.eu>2022-09-02 09:44:05 +0100
committerCarlton Gibson <carlton.gibson@noumenal.es>2022-10-04 09:10:04 +0200
commite5ea2842941967f06cefa10865f303b39c95279f (patch)
treed37fc62ab9c96ff088953a2b1207c115e44392df /tests
parent4771a1694b3b54c7309602820881d3ec9cc2c809 (diff)
Fixed CVE-2022-41323 -- Prevented locales being interpreted as regular expressions.
Thanks to Benjamin Balder Bach for the report.
Diffstat (limited to 'tests')
-rw-r--r--tests/i18n/patterns/tests.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/i18n/patterns/tests.py b/tests/i18n/patterns/tests.py
index 43d95ff668..0b104ff548 100644
--- a/tests/i18n/patterns/tests.py
+++ b/tests/i18n/patterns/tests.py
@@ -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):
"""