diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-06-14 12:23:06 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-07-03 08:19:23 +0200 |
| commit | b7c5feb35a31799de6e582ad6a5a91a9de74e0f9 (patch) | |
| tree | e1f30c69b702a3e042b67fefffd93dba749a7808 /django/forms/fields.py | |
| parent | 1ea11365f61a78051e196e6123d5f987efa90df1 (diff) | |
[4.2.x] Fixed CVE-2023-36053 -- Prevented potential ReDoS in EmailValidator and URLValidator.
Thanks Seokchan Yoon for reports.
Diffstat (limited to 'django/forms/fields.py')
| -rw-r--r-- | django/forms/fields.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/django/forms/fields.py b/django/forms/fields.py index 46de2f53a0..01cd831964 100644 --- a/django/forms/fields.py +++ b/django/forms/fields.py @@ -609,6 +609,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) |
