diff --git a/.github/actions/setup-python-env/action.yml b/.github/actions/setup-python-env/action.yml index 8e764b5..f4ea0e5 100644 --- a/.github/actions/setup-python-env/action.yml +++ b/.github/actions/setup-python-env/action.yml @@ -35,6 +35,8 @@ runs: args="$args --group docs" fi if [[ -n "$EXTRA_ARGS" ]]; then + # Validate each whitespace-split token: must start with '-' and contain only safe flag characters. + # NOTE: '--' (end-of-options marker) is intentionally allowed; positional args would fail validation. for arg in $EXTRA_ARGS; do if [[ ! "$arg" =~ ^-[a-zA-Z0-9=._:/@+-]+$ ]]; then echo "::error::Unsafe extra-args token: '$arg'. Each token must start with '-' and contain only safe flag characters." >&2 @@ -42,5 +44,5 @@ runs: fi done fi - # shellcheck disable=SC2086 # intentional word-splitting for uv flags + # shellcheck disable=SC2086 # intentional word-splitting for uv flags (all tokens validated above) uv sync $args $EXTRA_ARGS