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:
committed by
Carlton Gibson
parent
7843c43c49
commit
9d656ea51d
@@ -346,7 +346,7 @@ class LocalePrefixPattern:
|
||||
@property
|
||||
def regex(self):
|
||||
# This is only used by reverse() and cached in _reverse_dict.
|
||||
return re.compile(self.language_prefix)
|
||||
return re.compile(re.escape(self.language_prefix))
|
||||
|
||||
@property
|
||||
def language_prefix(self):
|
||||
|
||||
Reference in New Issue
Block a user