Skip to content

[2.7] bpo-34155: Dont parse domains containing @ (GH-13079) #16006

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

Merged
merged 1 commit into from
Sep 14, 2019
Merged

[2.7] bpo-34155: Dont parse domains containing @ (GH-13079) #16006

merged 1 commit into from
Sep 14, 2019

Conversation

rcsanchez97
Copy link

@rcsanchez97 rcsanchez97 commented Sep 11, 2019

This change skips parsing of email addresses where domains include a "@" character, which can be maliciously used since the local part is returned as a complete address.

(cherry picked from commit 8cb65d1)

Excludes changes to Lib/email/_header_value_parser.py, which did not
exist in 2.7.

Co-authored-by: jpic jpic@users.noreply.github.com

https://bugs.python.org/issue34155

Automerge-Triggered-By: @maxking

https://bugs.python.org/issue34155
(cherry picked from commit 8cb65d1)

Excludes changes to Lib/email/_header_value_parser.py, which did not
exist in 2.7.

Co-authored-by: jpic <jpic@users.noreply.github.com>
@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

Recognized GitHub username

We couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames:

@rcsanchez97

This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@vstinner
Copy link
Member

@rcsanchez97: Can you please sign the CLA? See the previous comment for the procedure.

@rcsanchez97
Copy link
Author

@vstinner That is very strange. I signed the CLA at the same time I created the PR. However, the CLA not signed label was only removed moments ago when I used the link to check that it had been recorded as being signed.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM. But I would prefer to have a double check from another core dev.

@maxking or @warsaw: Can you please review this PR?

I compared with 8cb65d1 : the code looks the same. The 2.7 backport lacks the get_domain() change which raises HeaderParseError: Python 2.7 doens't have the parser.get_addr_spec() function, so I understand that it doesn't need this change.

Copy link
Contributor

@maxking maxking left a comment

Choose a reason for hiding this comment

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

LGTM!

Thank @rcsanchez97 for the backport and @vstinner for helping review.

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.

6 participants