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-09-27 10:26:46 +0200
commit23f0093125ac2e553da6c1b2f9988eb6a3dd2ea1 (patch)
tree4aeab28badf4b6ea23985f542aeda9b6773488ef /tests
parent4a30e0db269a364cb480f48524fa48e6abcf9e94 (diff)
[4.0.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 db04e9a1a4..73a7619dfe 100644
--- a/tests/i18n/patterns/tests.py
+++ b/tests/i18n/patterns/tests.py
@@ -198,6 +198,12 @@ class URLTranslationTests(URLTestCaseBase):
self.assertEqual(translate_url("/nl/gebruikers/", "en"), "/en/users/")
self.assertEqual(translation.get_language(), "nl")
+ 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):
"""