          ipaddress.IPv4Address(value)
      except ValueError:
          raise ValidationError(_('Enter a valid IPv4 address.'), code='invalid', params={'value': value})
  
  
  def validate_ipv6_address(value):
      if not is_valid_ipv6_address(value):
 
</s> remove     ipv4_re = r'(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)(?:\.(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}'
 </s> add     ipv4_re = r'(?:0|25[0-5]|2[0-4]\d|1\d?\d?|[1-9]\d?)(?:\.(?:0|25[0-5]|2[0-4]\d|1\d?\d?|[1-9]\d?)){3}'
    else:
        # Leading zeros are forbidden to avoid ambiguity with the octal
        # notation. This restriction is included in Python 3.9.5+.
        # TODO: Remove when dropping support for PY39.
        if any(
            octet != '0' and octet[0] == '0'
            for octet in value.split('.')
        ):
            raise ValidationError(
                _('Enter a valid IPv4 address.'),
                code='invalid',
                params={'value': value},
            )
          ipaddress.IPv4Address(value)
      except ValueError:
          raise ValidationError(_('Enter a valid IPv4 address.'), code='invalid', params={'value': value})
    else:
        # Leading zeros are forbidden to avoid ambiguity with the octal
        # notation. This restriction is included in Python 3.9.5+.
        # TODO: Remove when dropping support for PY39.
        if any(
            octet != '0' and octet[0] == '0'
            for octet in value.split('.')
        ):
            raise ValidationError(
                _('Enter a valid IPv4 address.'),
                code='invalid',
                params={'value': value},
            )
  
  
  def validate_ipv6_address(value):
      if not is_valid_ipv6_address(value):
keep keep add keep keep keep keep
 Fixed CVE-2021-33571 -- Prevented leading zeros in IPv4 addresses.

validate_ipv4_address() was affected only on Python < 3.9.5, see [1].
URLValidator() uses a regular expressions and it was affected on all
Python versions.

[1] https://bugs.python.org/issue36384 
django/core/validators.py