Skip to content

Commit c33dcba

Browse files
committed
Fix help[template-injection]: code injection via template expansion
1 parent bd9e472 commit c33dcba

File tree

8 files changed

+16
-17
lines changed

8 files changed

+16
-17
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ jobs:
418418
#
419419
# (GH-104097) test_sysconfig is skipped because it has tests that are
420420
# failing when executed from inside a virtual environment.
421-
${{ env.VENV_PYTHON }} -m test \
421+
"${VENV_PYTHON}" -m test \
422422
-W \
423423
-o \
424424
-j4 \

.github/workflows/reusable-docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ jobs:
4141
if: github.event_name == 'pull_request'
4242
run: |
4343
# Fetch enough history to find a common ancestor commit (aka merge-base):
44-
git fetch origin ${{ env.refspec_pr }} --depth=$(( ${{ env.commits }} + 1 )) \
44+
git fetch origin "${refspec_pr}" --depth=$(( commits + 1 )) \
4545
--no-tags --prune --no-recurse-submodules
4646
4747
# This should get the oldest commit in the local fetched history (which may not be the commit the PR branched from):
48-
COMMON_ANCESTOR=$( git rev-list --first-parent --max-parents=0 --max-count=1 ${{ env.branch_pr }} )
48+
COMMON_ANCESTOR=$( git rev-list --first-parent --max-parents=0 --max-count=1 "${branch_pr}" )
4949
DATE=$( git log --date=iso8601 --format=%cd "${COMMON_ANCESTOR}" )
5050
5151
# Get all commits since that commit date from the base branch (eg: master or main):
52-
git fetch origin ${{ env.refspec_base }} --shallow-since="${DATE}" \
52+
git fetch origin "${refspec_base}" --shallow-since="${DATE}" \
5353
--no-tags --prune --no-recurse-submodules
5454
- name: 'Set up Python'
5555
uses: actions/setup-python@v5
@@ -71,7 +71,7 @@ jobs:
7171
if: github.event_name == 'pull_request'
7272
run: |
7373
python Doc/tools/check-warnings.py \
74-
--annotate-diff '${{ env.branch_base }}' '${{ env.branch_pr }}' \
74+
--annotate-diff "${branch_base}" "${branch_pr}" \
7575
--fail-if-regression \
7676
--fail-if-improved \
7777
--fail-if-new-news-nit

.github/workflows/reusable-tsan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
sudo sysctl -w vm.mmap_rnd_bits=28
5353
- name: TSAN Option Setup
5454
run: |
55-
echo "TSAN_OPTIONS=log_path=${GITHUB_WORKSPACE}/tsan_log suppressions=${GITHUB_WORKSPACE}/${{ env.SUPPRESSIONS_PATH }} handle_segv=0" >> "$GITHUB_ENV"
55+
echo "TSAN_OPTIONS=log_path=${GITHUB_WORKSPACE}/tsan_log suppressions=${GITHUB_WORKSPACE}/${SUPPRESSIONS_PATH} handle_segv=0" >> "$GITHUB_ENV"
5656
echo "CC=clang" >> "$GITHUB_ENV"
5757
echo "CXX=clang++" >> "$GITHUB_ENV"
5858
- name: Add ccache to PATH
@@ -64,7 +64,7 @@ jobs:
6464
save: ${{ github.event_name == 'push' }}
6565
max-size: "200M"
6666
- name: Configure CPython
67-
run: ${{ env.OPTIONS }}
67+
run: "${OPTIONS}"
6868
- name: Build CPython
6969
run: make -j4
7070
- name: Display build info

.github/workflows/reusable-ubuntu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
if: ${{ !inputs.free-threading }}
9797
run: >-
9898
python Tools/build/check_warnings.py
99-
--compiler-output-file-path=${{ env.CPYTHON_BUILDDIR }}/compiler_output_ubuntu.txt
99+
--compiler-output-file-path="${CPYTHON_BUILDDIR}/compiler_output_ubuntu.txt"
100100
--warning-ignore-file-path "${GITHUB_WORKSPACE}/Tools/build/.warningignore_ubuntu"
101101
--compiler-output-type=gcc
102102
--fail-on-regression

.github/workflows/reusable-wasi.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ jobs:
3636
- name: "Install WASI SDK" # Hard-coded to x64.
3737
if: steps.cache-wasi-sdk.outputs.cache-hit != 'true'
3838
run: |
39-
mkdir ${{ env.WASI_SDK_PATH }} && \
40-
curl -s -S --location https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${{ env.WASI_SDK_VERSION }}/wasi-sdk-${{ env.WASI_SDK_VERSION }}.0-x86_64-linux.tar.gz | \
41-
tar --strip-components 1 --directory ${{ env.WASI_SDK_PATH }} --extract --gunzip
39+
mkdir "${WASI_SDK_PATH}" && \
40+
curl -s -S --location "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux.tar.gz" | \
41+
tar --strip-components 1 --directory "${WASI_SDK_PATH}" --extract --gunzip
4242
- name: "Configure ccache action"
4343
uses: hendrikmuhs/[email protected]
4444
with:
@@ -74,6 +74,6 @@ jobs:
7474
- name: "Make host"
7575
run: python3 Tools/wasm/wasi.py make-host
7676
- name: "Display build info"
77-
run: make --directory ${{ env.CROSS_BUILD_WASI }} pythoninfo
77+
run: make --directory "${CROSS_BUILD_WASI}" pythoninfo
7878
- name: "Test"
79-
run: make --directory ${{ env.CROSS_BUILD_WASI }} test
79+
run: make --directory "${CROSS_BUILD_WASI}" test

.github/workflows/reusable-windows-msi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ jobs:
2424
with:
2525
persist-credentials: false
2626
- name: Build CPython installer
27-
run: .\Tools\msi\build.bat --doc -${{ env.ARCH }}
27+
run: .\Tools\msi\build.bat --doc -"${ARCH}"

.github/workflows/reusable-windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
run: >-
4040
.\\PCbuild\\build.bat
4141
-e -d -v
42-
-p ${{ env.ARCH }}
42+
-p "${ARCH}"
4343
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
4444
- name: Display build info # FIXME(diegorusso): remove the `if`
4545
if: inputs.arch != 'arm64'
@@ -48,6 +48,6 @@ jobs:
4848
if: inputs.arch != 'arm64'
4949
run: >-
5050
.\\PCbuild\\rt.bat
51-
-p ${{ env.ARCH }}
51+
-p "${ARCH}"
5252
-d -q --fast-ci
5353
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ repos:
6565
rev: v0.8.0
6666
hooks:
6767
- id: zizmor
68-
args: [--min-severity=medium]
6968

7069
- repo: https://github.com/sphinx-contrib/sphinx-lint
7170
rev: v1.0.0

0 commit comments

Comments
 (0)