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

gh-114539: Clarify implicit launching of shells by subprocess #117996

Merged
merged 2 commits into from
Apr 17, 2024

Conversation

zooba
Copy link
Member

@zooba zooba commented Apr 17, 2024

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/

Copy link
Contributor

@sethmlarson sethmlarson left a comment

Choose a reason for hiding this comment

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

Thanks Steve! LGTM

@zooba zooba merged commit a4b44d3 into python:main Apr 17, 2024
27 checks passed
@miss-islington-app
Copy link

Thanks @zooba for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9, 3.10, 3.11, 3.12.
🐍🍒⛏🤖

@zooba zooba deleted the gh-114539 branch April 17, 2024 18:32
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 17, 2024
@bedevere-app
Copy link

bedevere-app bot commented Apr 17, 2024

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

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Apr 17, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 17, 2024
@bedevere-app
Copy link

bedevere-app bot commented Apr 17, 2024

GH-118003 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Apr 17, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 17, 2024
@bedevere-app
Copy link

bedevere-app bot commented Apr 17, 2024

GH-118004 is a backport of this pull request to the 3.10 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.10 only security fixes label Apr 17, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 17, 2024
@bedevere-app
Copy link

bedevere-app bot commented Apr 17, 2024

GH-118005 is a backport of this pull request to the 3.9 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.9 only security fixes label Apr 17, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 17, 2024
@bedevere-app
Copy link

bedevere-app bot commented Apr 17, 2024

GH-118006 is a backport of this pull request to the 3.8 branch.

zooba added a commit that referenced this pull request Apr 17, 2024
…H-117996) (#118002)

gh-114539: Clarify implicit launching of shells by subprocess (GH-117996)
(cherry picked from commit a4b44d3)

Co-authored-by: Steve Dower <[email protected]>
ambv pushed a commit that referenced this pull request May 7, 2024
ambv pushed a commit that referenced this pull request May 7, 2024
ambv pushed a commit that referenced this pull request May 7, 2024
hugovk pushed a commit that referenced this pull request Aug 9, 2024
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 news type-security A security issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants