-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
gh-114539: Clarify implicit launching of shells by subprocess #117996
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Steve! LGTM
Thanks @zooba for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9, 3.10, 3.11, 3.12. |
…ythonGH-117996) (cherry picked from commit a4b44d3) Co-authored-by: Steve Dower <[email protected]>
GH-118002 is a backport of this pull request to the 3.12 branch. |
…ythonGH-117996) (cherry picked from commit a4b44d3) Co-authored-by: Steve Dower <[email protected]>
GH-118003 is a backport of this pull request to the 3.11 branch. |
…ythonGH-117996) (cherry picked from commit a4b44d3) Co-authored-by: Steve Dower <[email protected]>
GH-118004 is a backport of this pull request to the 3.10 branch. |
…ythonGH-117996) (cherry picked from commit a4b44d3) Co-authored-by: Steve Dower <[email protected]>
GH-118005 is a backport of this pull request to the 3.9 branch. |
…ythonGH-117996) (cherry picked from commit a4b44d3) Co-authored-by: Steve Dower <[email protected]>
GH-118006 is a backport of this pull request to the 3.8 branch. |
…H-117996) (GH-118004) (cherry picked from commit a4b44d3) Co-authored-by: Steve Dower <[email protected]>
…H-117996) (GH-118005) (cherry picked from commit a4b44d3) Co-authored-by: Steve Dower <[email protected]>
…H-117996) (GH-118006) (cherry picked from commit a4b44d3) Co-authored-by: Steve Dower <[email protected]>
…H-117996) (#118003) Co-authored-by: Steve Dower <[email protected]>
This is the same issue as recently disclosed by Rust (CVE-2024-24576), but as it is intentional operating system behaviour, we consider it to not be a Python vulnerability. If an attacker can influence the executable argument and other arguments, no reasonable validation can detect this case (without actually launching the executable and seeing what happens), and the app is exploitable already.
Rust was already detecting whether the executable was a batch file and changing their behaviour, which is why they chose to apply a fix. Python does no such detection, but relies exclusively on the
shell
argument.📚 Documentation preview 📚: https://cpython-previews--117996.org.readthedocs.build/