Other validators that use \d may be affected as well.
--
Ticket URL: <https://code.djangoproject.com/ticket/26578>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_docs: => 0
* needs_better_patch: => 0
* component: Uncategorized => Core (Other)
* needs_tests: => 0
* stage: Unreviewed => Accepted
Comment:
See also #22378.
--
Ticket URL: <https://code.djangoproject.com/ticket/26578#comment:1>
* owner: nobody => yakky
* status: new => assigned
* cc: github@… (added)
Comment:
I'm willing to work on this. Following what has been done in #22378 fix is
replacing `\d` with `[0-9]+` in relevant validators
--
Ticket URL: <https://code.djangoproject.com/ticket/26578#comment:2>
Comment (by the-kid89):
I would suggest something a little more extensive for validating IP
addresses. This will get almost all invalid IP addresses. Though it does
still have problems with an IP address like "192.168.00.10".
"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"
--
Ticket URL: <https://code.djangoproject.com/ticket/26578#comment:3>
Comment (by timgraham):
Well, actually we're trying to simplify the regular expressions we use at
least in some other places (e.g. #26423). Complex regular expressions are
difficult to maintain and have resulted in recursive backtracking security
issues.
--
Ticket URL: <https://code.djangoproject.com/ticket/26578#comment:4>
Comment (by the-kid89):
Replying to [comment:4 timgraham]:
> Well, actually we're trying to simplify the regular expressions we use
at least in some other places (e.g. #26423). Complex regular expressions
are difficult to maintain and have resulted in recursive backtracking
security issues.
If having a more complex but more accurate regex validation could cause a
security issue then its not worth it.
--
Ticket URL: <https://code.djangoproject.com/ticket/26578#comment:5>
* cc: greyzmeem@… (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/26578#comment:6>
* needs_better_patch: 0 => 1
* has_patch: 0 => 1
Comment:
The [https://github.com/django/django/pull/7435 PR] could use a few more
tests.
--
Ticket URL: <https://code.djangoproject.com/ticket/26578#comment:7>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"21dd792349ada4b68abf8fa3b50c0041438a89d9" 21dd7923]:
{{{
#!CommitTicketReference repository=""
revision="21dd792349ada4b68abf8fa3b50c0041438a89d9"
Fixed #26578 -- Prohibited non-ASCII digits in validate_ipv4_address.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26578#comment:8>