-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
[CVE-2024-9287] venv
activation scripts do not quote strings properly
#124651
Comments
Hey @y5c4l3, thanks for reporting this. We're going to treat this as a low-risk security issue. You or anyone else can submit a fix normally. If you have questions about this, send an email to [email protected]. |
@sethmlarson Thanks for the reply! Could you please help me with a code review for this PR as well as #124155? The code owner for |
…4712) This patch properly quotes template strings in `venv` activation scripts. This mitigates potential command injection.
…ythonGH-124712) This patch properly quotes template strings in `venv` activation scripts. This mitigates potential command injection. (cherry picked from commit d48cc82) Co-authored-by: Y5 <[email protected]>
…GH-124712) (GH-125813) (cherry picked from commit d48cc82)
can we keep this open until all of the security branch backports are done? |
…ythonGH-124712) This patch properly quotes template strings in `venv` activation scripts. This mitigates potential command injection. (cherry picked from commit d48cc82)
…ythonGH-124712) This patch properly quotes template strings in `venv` activation scripts. This mitigates potential command injection. (cherry picked from commit d48cc82)
Do you want to backport it up to 3.9 as well? If so, don't forget to add the backport labels on the PR (for now, we only have 3.12+) |
…GH-124712) (GH-126185) (cherry picked from commit d48cc82)
Cherry pick fixes for https://nvd.nist.gov/vuln/detail/CVE-2024-9287 from commits listed here python/cpython#124651
Cherry pick fixes for https://nvd.nist.gov/vuln/detail/CVE-2024-9287 from commits listed here python/cpython#124651
…cripts (cherry picked from 3.9)
…GH-124712) (GH-126185) (GH-126269) (GH-126300) (cherry picked from commit ae961ae)
I close the issue. The fix was applied to all branches. |
Cherry pick fixes for https://nvd.nist.gov/vuln/detail/CVE-2024-9287 from commits listed here python/cpython#124651 Advisory for the package is here wolfi-dev/advisories#8825 Signed-off-by: Aditvil-Dev <[email protected]>
…cripts (cherry picked from 3.9)
This patch properly quotes template strings in venv activation scripts. This mitigates potential command injection. Fixes: bsc#1232241 (CVE-2024-9287) Fixes: gh#python#124651 Co-authored-by: y5c4l3 <[email protected]> Co-authored-by: Victor Stinner <[email protected]> From-PR: gh#python/cpython!124712 Patch: CVE-2024-9287-venv_path_unquoted.patch
venv
activation scripts do not quote strings properlyvenv
activation scripts do not quote strings properly
Bug report
Bug description:
Crafted paths break the script templates:
Like pypa/virtualenv#2768 the execution path itself is low-risk, but it enables many potential downstream attack vectors. Downstream projects that automatically initialize and activate
venv
at a controllable path (e.g. read from repo configuration file) could execute unexpected commands.CPython versions tested on:
3.8, 3.9, 3.10, 3.11, 3.12, 3.13, CPython main branch
Operating systems tested on:
Linux
Linked PRs
venv
activation scripts #124712venv
activation scripts (GH-124712) #125813venv
activation scripts (GH-124712) #125947venv
activation scripts (GH-124712) #126185venv
activation scripts (GH-124712) (GH-126185) #126269venv
activation scripts (GH-124712) (GH-126185) (#126269) #126300venv
activation scripts (GH-124712) (GH-126185) (#126269) #126301The text was updated successfully, but these errors were encountered: