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:12:42 +0200
commit9d656ea51d9ea7105c0c0785783ac29d426a7d25 (patch)
tree212f2bd6941f620a763261d58dcfe7bdf29d62cf /tests
parent7843c43c49d3845a1cbebfaaf71f2f0c2a9d8fce (diff)
[4.1.x] 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):
"""