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

[3.12] gh-124651: Quote template strings in venv activation scripts (GH-124712) #126185

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Oct 30, 2024

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)
@vstinner
Copy link
Member Author

Please review carefully my backport, I'm not sure of what I did :-)

@y5c4l3 @vsajip: Would you mind to review my backport to 3.12?

There was a merge conflict on Lib/venv/__init__.py because of context.script_path = srcfile.

I also backported manually the changes to:

  • Lib/venv/scripts/common/activate
  • Lib/venv/scripts/posix/activate.csh
  • Lib/venv/scripts/posix/activate.fish

I removed quotes around __VENV_xxx__ variables.

@vsajip vsajip added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Oct 30, 2024
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @vsajip for commit 1408cc9 🤖

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Oct 30, 2024
@vsajip vsajip merged commit 8450b24 into python:3.12 Oct 31, 2024
94 of 102 checks passed
@vstinner vstinner deleted the venv12 branch October 31, 2024 21:47
@bedevere-app
Copy link

bedevere-app bot commented Nov 1, 2024

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

@vstinner
Copy link
Member Author

vstinner commented Nov 1, 2024

Thanks for the review @vsajip!

ambv pushed a commit that referenced this pull request Nov 4, 2024
ambv pushed a commit that referenced this pull request Nov 4, 2024
Redent0r added a commit to Redent0r/CBL-Mariner that referenced this pull request Nov 6, 2024
Taken from python/cpython#126185 which is a 3.12 backport of
python/cpython#124712

Signed-off-by: Saul Paredes <[email protected]>
Redent0r added a commit to Redent0r/CBL-Mariner that referenced this pull request Nov 6, 2024
Taken from python/cpython#126185 which is a 3.12 backport of
python/cpython#124712

Signed-off-by: Saul Paredes <[email protected]>
Redent0r added a commit to Redent0r/CBL-Mariner that referenced this pull request Nov 7, 2024
Taken from python/cpython#126185 which is a 3.12 backport of
python/cpython#124712

Signed-off-by: Saul Paredes <[email protected]>
Redent0r added a commit to Redent0r/CBL-Mariner that referenced this pull request Nov 7, 2024
Taken from python/cpython#126185 which is a 3.12 backport of
python/cpython#124712

Signed-off-by: Saul Paredes <[email protected]>
Redent0r added a commit to Redent0r/CBL-Mariner that referenced this pull request Nov 7, 2024
Taken from python/cpython#126185 which is a 3.12 backport of
python/cpython#124712

Signed-off-by: Saul Paredes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants