Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34k
gh-142412: Add warning about urlsplit's netloc parsing and open redirects#144448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -530,6 +530,17 @@ | ||
| sense? Is that a sensible ``path``? Is there anything strange about that | ||
| ``hostname``? etc. | ||
| .. warning:: | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. It does not make sense to have a warning note here. In addition, its placing interrupts the flow of the current text and is quite off-topic here. | ||
| :func:`urlsplit` (and :func:`urlparse`) does not consider a URL's | ||
| :attr:`~urllib.parse.SplitResult.netloc` to be present unless | ||
| it is preceded by ``//``. This means that, for example, the URL | ||
| ``///example.com/path`` will be parsed with an empty ``netloc`` and a | ||
| ``path`` of ``/example.com/path``. This behavior may lead to open redirect | ||
| vulnerabilities in applications that rely on checking the ``netloc`` to | ||
| validate redirect URLs. Always carefully validate redirect targets, | ||
| preferably using an allowlist of known-safe URLs or hosts. | ||
| What constitutes a URL is not universally well defined. Different applications | ||
| have different needs and desired constraints. For instance the living `WHATWG | ||
| spec`_ describes what user facing web clients such as a web browser require. | ||
Uh oh!
There was an error while loading.Please reload this page.