Skip to content

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

Merged
zooba merged 2 commits into
python:masterfrom
zooba:urllib-bug
Mar 7, 2019
Merged

bpo-36216: Add check for characters in netloc that normalize to separators#12201
zooba merged 2 commits into
python:masterfrom
zooba:urllib-bug

Conversation

@zooba

@zooba zooba commented Mar 6, 2019

Copy link
Copy Markdown
Member

Comment thread Lib/urllib/parse.py Outdated

@tiran tiran left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown

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

@tiran

tiran commented Mar 6, 2019

Copy link
Copy Markdown
Member

sorry, GH didn't refresh.

@zooba

zooba commented Mar 7, 2019

Copy link
Copy Markdown
Member Author

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
Comment thread Lib/urllib/parse.py
netloc2 = unicodedata.normalize('NFKC', netloc)
if netloc == netloc2:
return
_, _, netloc = netloc.rpartition('@') # anything to the left of '@' is okay

@mcepl mcepl May 28, 2019

Copy link
Copy Markdown
Contributor

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.

5 participants