gh-105704: Disallow square brackets ([ and ]) in domain names for parsed URLs#129418
Merged
orsenthil merged 4 commits intopython:mainfrom Jan 31, 2025
Merged
gh-105704: Disallow square brackets ([ and ]) in domain names for parsed URLs#129418orsenthil merged 4 commits intopython:mainfrom
[ and ]) in domain names for parsed URLs#129418orsenthil merged 4 commits intopython:mainfrom
Conversation
Misc/NEWS.d/next/Security/2025-01-28-14-08-03.gh-issue-105704.EnhHxu.rst
Outdated
Show resolved
Hide resolved
vstinner
reviewed
Jan 30, 2025
| self.assertRaises(ValueError, urllib.parse.urlsplit, 'scheme://prefix.[::1]?') | ||
| self.assertRaises(ValueError, urllib.parse.urlsplit, 'scheme://[::1].suffix?') | ||
| self.assertRaises(ValueError, urllib.parse.urlsplit, 'scheme://user@prefix.[v6a.ip]') | ||
| self.assertRaises(ValueError, urllib.parse.urlsplit, 'scheme://user@[v6a.ip].suffix') |
Member
There was a problem hiding this comment.
It might be helpful to add tests only with [, and tests only with ]. Such URL is also invalid, no?
Contributor
Author
There was a problem hiding this comment.
Yeah, I'll add tests with that structure too! Thanks :)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
orsenthil
reviewed
Jan 30, 2025
Contributor
Author
|
The failure in Windows free-threading looks unrelated, I can't merge without all the checks passing so if someone else can that would be appreciated 💜 |
Member
|
Looks like that's a required to succeed. |
|
Thanks @sethmlarson for the PR, and @orsenthil for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10, 3.11, 3.12, 3.13. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Jan 31, 2025
…es for parsed URLs (pythonGH-129418) * pythongh-105704: Disallow square brackets ( and ) in domain names for parsed URLs * Use Sphinx references Co-authored-by: Peter Bierma <zintensitydev@gmail.com> * Add mismatched bracket test cases, fix news format * Add more test coverage for ports --------- (cherry picked from commit d89a5f6) Co-authored-by: Seth Michael Larson <seth@python.org> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
|
GH-129526 is a backport of this pull request to the 3.13 branch. |
This was referenced Feb 4, 2025
srinivasreddy
pushed a commit
to srinivasreddy/cpython
that referenced
this pull request
Feb 7, 2025
…es for parsed URLs (python#129418) * pythongh-105704: Disallow square brackets ( and ) in domain names for parsed URLs * Use Sphinx references Co-authored-by: Peter Bierma <zintensitydev@gmail.com> * Add mismatched bracket test cases, fix news format * Add more test coverage for ports --------- Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Merged
1 task
The-Compiler
added a commit
to qutebrowser/qutebrowser
that referenced
this pull request
Feb 17, 2025
gentoo-bot
pushed a commit
to gentoo/cpython
that referenced
this pull request
Apr 9, 2025
…in names for parsed URLs (pythonGH-129418) (python#129530) (cherry picked from commit d89a5f6) Co-authored-by: Seth Michael Larson <seth@python.org> Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This was referenced May 19, 2025
Merged
chadkouse
pushed a commit
to chadkouse/qutebrowser
that referenced
this pull request
Jul 31, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opening this pull request in favor of #111261, as the original author appears to not be responding to reviews. This moves the error to occur during parsing instead of on the
ParseResultproperties.cc @gpshead @orsenthil @pschoen-itsc as reviewers on the previous PR.