diff options
| author | Adam Johnson <me@adamj.eu> | 2022-09-02 09:44:05 +0100 |
|---|---|---|
| committer | Carlton Gibson <carlton.gibson@noumenal.es> | 2022-09-27 10:17:34 +0200 |
| commit | 5b6b257fa7ec37ff27965358800c67e2dd11c924 (patch) | |
| tree | d02c8e1249fcc8605d51595aea7e1ab1224a2ced /tests/i18n/patterns/tests.py | |
| parent | 33affaf0b67f0e88bd3d8226476ff2822c821366 (diff) | |
[3.2.x] Fixed CVE-2022-41323 -- Prevented locales being interpreted as regular expressions.
Thanks to Benjamin Balder Bach for the report.
Diffstat (limited to 'tests/i18n/patterns/tests.py')
| -rw-r--r-- | tests/i18n/patterns/tests.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/i18n/patterns/tests.py b/tests/i18n/patterns/tests.py index 96e9453e9e..3b0ece9d89 100644 --- a/tests/i18n/patterns/tests.py +++ b/tests/i18n/patterns/tests.py @@ -172,6 +172,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): """ |
