Skip to content

Commit 7963c85

Browse files
[Github] Fix security issues in libcxx-run-benchmarks.yml workflow
There was one action dependency that was not hash pinned and this workflow also allowed code injection as the input might not be properly escaped when dumped into the run script.
1 parent b6014b6 commit 7963c85

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/libcxx-run-benchmarks.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ jobs:
3333
3434
runs-on: llvm-premerge-libcxx-next-runners # TODO: This should run on a dedicated set of machines
3535
steps:
36-
- uses: actions/setup-python@v6
36+
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
3737
with:
3838
python-version: '3.10'
3939

4040
- name: Extract information from the PR
4141
id: vars
42+
env:
43+
COMMENT_BODY: ${{ github.event.comment.body }}
4244
run: |
4345
python3 -m venv .venv
4446
source .venv/bin/activate
@@ -51,7 +53,7 @@ jobs:
5153
print(f"pr_base={pr.base.sha}")
5254
print(f"pr_head={pr.head.sha}")
5355
EOF
54-
BENCHMARKS=$(echo "${{ github.event.comment.body }}" | sed -nE 's/\/libcxx-bot benchmark (.+)/\1/p')
56+
BENCHMARKS=$(echo "$COMMENT_BODY" | sed -nE 's/\/libcxx-bot benchmark (.+)/\1/p')
5557
echo "benchmarks=${BENCHMARKS}" >> ${GITHUB_OUTPUT}
5658
5759
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

0 commit comments

Comments
 (0)