Skip to content

Added a warning to the urljoin docs, indicating that it is not safe to use with attacker controlled URLs #126659

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
Nov 15, 2024

Conversation

alex
Copy link
Member

@alex alex commented Nov 11, 2024

This was flagged to me at a party today by someone who works in red-teaming as a frequently encountered footgun. Documenting the potentially unexpected behavior seemed like a good place to start.


📚 Documentation preview 📚: https://cpython-previews--126659.org.readthedocs.build/

…o use with attacker controlled URLs

This was flagged to me at a party today by someone who works in red-teaming as a frequently encountered footgun. Documenting the potentially unexpected behavior seemed like a good place to start.
``urljoin("https://website.com/users/", username)``, if ``username`` can
contain an absolute URL, the result of ``urljoin`` will be the absolute
URL.


.. versionchanged:: 3.5

This comment was marked as spam.

ByteJoseph

This comment was marked as spam.

@alex alex requested a review from sethmlarson November 12, 2024 12:59
@Eclips4 Eclips4 added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes labels Nov 15, 2024
@alex
Copy link
Member Author

alex commented Nov 15, 2024

@Eclips4 Thanks for the review! I'm forgetting the workflow here, do I merge?

@Eclips4
Copy link
Member

Eclips4 commented Nov 15, 2024

@Eclips4 Thanks for the review! I'm forgetting the workflow here, do I merge?

Yup. @miss-islington will take care of backports to 3.12 and 3.13.

@alex
Copy link
Member Author

alex commented Nov 15, 2024

Great, thanks.

@alex alex merged commit d6bcc15 into python:main Nov 15, 2024
42 checks passed
@alex alex deleted the urljoin-warning branch November 15, 2024 23:09
@miss-islington-app
Copy link

Thanks @alex for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 15, 2024
…o use with attacker controlled URLs (pythonGH-126659)

This was flagged to me at a party today by someone who works in red-teaming as a frequently encountered footgun. Documenting the potentially unexpected behavior seemed like a good place to start.
(cherry picked from commit d6bcc15)

Co-authored-by: Alex Gaynor <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Nov 15, 2024

GH-126888 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Nov 15, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 15, 2024
…o use with attacker controlled URLs (pythonGH-126659)

This was flagged to me at a party today by someone who works in red-teaming as a frequently encountered footgun. Documenting the potentially unexpected behavior seemed like a good place to start.
(cherry picked from commit d6bcc15)

Co-authored-by: Alex Gaynor <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Nov 15, 2024

GH-126889 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Nov 15, 2024
Eclips4 pushed a commit that referenced this pull request Nov 15, 2024
… safe to use with attacker controlled URLs (GH-126659) (#126888)

Added a warning to the urljoin docs, indicating that it is not safe to use with attacker controlled URLs (GH-126659)

This was flagged to me at a party today by someone who works in red-teaming as a frequently encountered footgun. Documenting the potentially unexpected behavior seemed like a good place to start.
(cherry picked from commit d6bcc15)

Co-authored-by: Alex Gaynor <[email protected]>
Eclips4 pushed a commit that referenced this pull request Nov 15, 2024
… safe to use with attacker controlled URLs (GH-126659) (#126889)

Added a warning to the urljoin docs, indicating that it is not safe to use with attacker controlled URLs (GH-126659)

This was flagged to me at a party today by someone who works in red-teaming as a frequently encountered footgun. Documenting the potentially unexpected behavior seemed like a good place to start.
(cherry picked from commit d6bcc15)

Co-authored-by: Alex Gaynor <[email protected]>
picnixz pushed a commit to picnixz/cpython that referenced this pull request Dec 8, 2024
…o use with attacker controlled URLs (pythonGH-126659)

This was flagged to me at a party today by someone who works in red-teaming as a frequently encountered footgun. Documenting the potentially unexpected behavior seemed like a good place to start.
ebonnal pushed a commit to ebonnal/cpython that referenced this pull request Jan 12, 2025
…o use with attacker controlled URLs (pythonGH-126659)

This was flagged to me at a party today by someone who works in red-teaming as a frequently encountered footgun. Documenting the potentially unexpected behavior seemed like a good place to start.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip issue skip news
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants