Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/actions/setup-python-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ runs:
# 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
# Denylist: block flags that could redirect dependency resolution to an attacker-controlled index.
if [[ "$arg" =~ ^--(index-url|extra-index-url|trusted-host|find-links)(=|$) ]]; then
echo "::error::Blocked dangerous extra-args token: '$arg'. Registry overrides are not permitted." >&2
exit 1
fi
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
exit 1
Expand Down