Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-36216: Add check for characters in netloc that normalize to separators #12201

Merged
merged 2 commits into from
Mar 7, 2019

Conversation

zooba
Copy link
Member

@zooba zooba commented Mar 6, 2019

Lib/urllib/parse.py Outdated Show resolved Hide resolved
Copy link
Member

@tiran tiran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please optimize import unicodedata.

@bedevere-bot
Copy link

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

@tiran
Copy link
Member

tiran commented Mar 6, 2019

sorry, GH didn't refresh.

@zooba
Copy link
Member Author

zooba commented Mar 7, 2019

I'm removing the "needs backport" tags and will create the backports manually. In particular, the docs need to be slightly different for each version.

I'll probably also have to come back later and add the CVE reference once we're assigned one (if we want it in there).

@zooba zooba merged commit 16e6f7d into python:master Mar 7, 2019
@zooba zooba deleted the urllib-bug branch March 7, 2019 16:03
zooba added a commit to zooba/cpython that referenced this pull request Mar 7, 2019
zooba added a commit to zooba/cpython that referenced this pull request Mar 7, 2019
zooba added a commit to zooba/cpython that referenced this pull request Mar 7, 2019
zooba added a commit to zooba/cpython that referenced this pull request Mar 7, 2019
netloc2 = unicodedata.normalize('NFKC', netloc)
if netloc == netloc2:
return
_, _, netloc = netloc.rpartition('@') # anything to the left of '@' is okay
Copy link
Contributor

@mcepl mcepl May 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zooba @tiran Could you tell me something about this line (it is now https://github.com/python/cpython/blob/master/Lib/urllib/parse.py#L405)? It seems to me that it exactly makes the first example from https://bugs.python.org/issue36216 fail as before:

>>> u = "https://example.com\uFF03@bing.com"
>>> urlsplit(u).netloc.rpartition("@")[2]
bing.com

mingwandroid pushed a commit to mingwandroid/cpython that referenced this pull request Aug 6, 2019
mingwandroid pushed a commit to mingwandroid/cpython that referenced this pull request Aug 6, 2019
mingwandroid pushed a commit to mingwandroid/cpython that referenced this pull request Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-security A security issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants