Skip to content

Commit 4ccac8e

Browse files
committed
fix(ci): Sanitize workflow inputs with an env var
Use an intermediate env var, sanitized by GitHub, to prevent exploitation from untrusted user-provided input. Reported-By: Alessandro Braccio <[email protected]> Signed-off-by: Loïc Minier <[email protected]>
1 parent f1d93be commit 4ccac8e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/build-overlay-deb.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
matrix:
1515
arch: [amd64, arm64]
1616
runs-on: [self-hosted, qcom-u2404, "${{ matrix.arch }}"]
17+
env:
18+
- CONFIG: ${{ inputs.config }}
1719
container:
1820
image: public.ecr.aws/debian/debian:trixie
1921
options: --privileged # Required for chroot creation
@@ -51,7 +53,7 @@ jobs:
5153
DEBIAN_FRONTEND=noninteractive \
5254
apt -y install --no-install-recommends python3 python3-yaml
5355
# read suite from yaml
54-
suite="$(python3 -c "import yaml; print(yaml.safe_load(open('${{ inputs.config }}'))['suite'])")"
56+
suite="$(python3 -c "import os, yaml; print(yaml.safe_load(open(os.environ['CONFIG']))['suite'])")"
5557
# defaults args
5658
extra_repo=""
5759
debootstrap_suite="${suite}"

0 commit comments

Comments
 (0)