mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed CVE-2023-36053 -- Prevented potential ReDoS in EmailValidator and URLValidator.
Thanks Seokchan Yoon for reports.
This commit is contained in:
@@ -616,6 +616,9 @@ class EmailField(CharField):
|
||||
default_validators = [validators.validate_email]
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
# The default maximum length of an email is 320 characters per RFC 3696
|
||||
# section 3.
|
||||
kwargs.setdefault("max_length", 320)
|
||||
super().__init__(strip=True, **kwargs)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user