Skip to content

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

Merged
vsajip merged 1 commit into
python:3.12from
vstinner:venv12
Oct 31, 2024
Merged

vsajip merged 1 commit into
python:3.12from
vstinner:venv12

Conversation

@vstinner

@vstinner vstinner commented Oct 30, 2024 •

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown

🤖 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
@vstinner
vstinner deleted the venv12 branch October 31, 2024 21:47
@bedevere-app

bedevere-app Bot commented Nov 1, 2024

Copy link
Copy Markdown

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

@vstinner

vstinner commented Nov 1, 2024

Copy link
Copy Markdown
Member Author

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 <saulparedes@microsoft.com>
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 <saulparedes@microsoft.com>
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 <saulparedes@microsoft.com>
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 <saulparedes@microsoft.com>
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 <saulparedes@microsoft.com>
Redent0r added a commit to Redent0r/CBL-Mariner that referenced this pull request Nov 26, 2024
Taken from python/cpython#126185 which is a 3.12 backport of
python/cpython#124712

Signed-off-by: Saul Paredes <saulparedes@microsoft.com>
Redent0r added a commit to Redent0r/CBL-Mariner that referenced this pull request Dec 18, 2024
Taken from python/cpython#126185 which is a 3.12 backport of
python/cpython#124712

Signed-off-by: Saul Paredes <saulparedes@microsoft.com>
Redent0r added a commit to Redent0r/CBL-Mariner that referenced this pull request Dec 18, 2024
Taken from python/cpython#126185 which is a 3.12 backport of
python/cpython#124712

Signed-off-by: Saul Paredes <saulparedes@microsoft.com>
rickprice pushed a commit to ActiveState/cpython that referenced this pull request Mar 6, 2025
rickprice pushed a commit to ActiveState/cpython that referenced this pull request Mar 6, 2025
rickprice pushed a commit to ActiveState/cpython that referenced this pull request Mar 7, 2025
gentoo-bot pushed a commit to gentoo/cpython that referenced this pull request Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants