Security: Replace extra-args denylist with allowlist in setup-python-env composite action#91
Open
Security: Replace extra-args denylist with allowlist in setup-python-env composite action#91
extra-args denylist with allowlist in setup-python-env composite action#91Conversation
…env action Co-authored-by: pmalarme <686568+pmalarme@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Replace extra-args denylist with allowlist in setup-python-env
Security: Replace Feb 19, 2026
extra-args denylist with allowlist in setup-python-env composite action
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the .github/actions/setup-python-env composite action by replacing the previous extra-args denylist with a strict allowlist, reducing the risk of unsafe uv sync flag injection while keeping current workflow usage supported.
Changes:
- Replace denylist-based token validation for
extra-argswith an explicit allowlist of four permitteduv syncflags. - Update the action README security note to document the allowlist behavior and enumerate permitted flags.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/actions/setup-python-env/action.yml |
Enforces a strict allowlist for extra-args tokens before passing them to uv sync. |
.github/actions/setup-python-env/README.md |
Updates documentation to reflect allowlist validation and lists permitted flags. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
extra-argsinput in thesetup-python-envcomposite action used a denylist to block a handful of dangerousuv syncflags, leaving many others (e.g.--python,--no-build-isolation,--constraint,--no-sources) unguarded.Changes
.github/actions/setup-python-env/action.yml— Replace two-step denylist (blocked-flags regex + character pattern) with a strict bash allowlist. Only four flags are permitted; anything else fails immediately with a descriptive error:.github/actions/setup-python-env/README.md— Update Security note to document the allowlist approach and enumerate the four permitted flags.The four allowed flags cover all current usages in the repo (
--all-packagesinpython-docs.yml;-U/--upgrade/--prerelease=…documented in the README example).Testing
uv run poe check--index-url,--python,--no-build-isolation,--constraint,--no-sources) correctly rejectedChecklist
Additional context
--all-packagesor noextra-args; no breaking change to current workflows.Original prompt
extra-argsdenylist with allowlist insetup-python-envcomposite action #67✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.