#29525: Handle strings as allowed_hosts arguments to is_safe_url()
------------------------------------------------+------------------------
Reporter: Przemysław Suliga | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Utilities | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
`is_safe_url()` expects a sequence of strings as its `allowed_hosts`
argument like this
{{{
>>> is_safe_url('http://example.com/abc', allowed_hosts={'example.com'})
True
}}}
When `allowed_hosts` is passed in incorrectly as a string instead of as a
sequence of strings like this
{{{
>>> is_safe_url('http://good.co/evil', allowed_hosts='good.com')
True
}}}
`is_safe_url()` will return `True` for some cases which might be
exploited.
Since `is_safe_url()` is not Django's public API, I decided to not go via
`[email protected]`.
Proposed solution is in https://github.com/django/django/pull/10082
--
Ticket URL: <https://code.djangoproject.com/ticket/29525>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/050.cc1b9d99233cca6455f25d6b818dad19%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.