fix(ci): pass PR head ref as data, scope contents:write to publish job (PMS-500) #372
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/PMS-500-harden-create-release-injection"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The create-release workflow interpolated attacker-controlled github.event.* values (the PR head ref and merged flag) directly into bash and Nushell command text, allowing shell/script injection in a PR-triggered job that held a contents:write token.
Pass those values through the env: mapping and reference them as $HEAD_REF /
env.HEAD_REF so they are treated as data, not code. Split the workflow into a read-only gate job and a create-release publish job so contents:write is granted only to the step that actually publishes. The gate validates the head ref against a strict ^release/v[0-9.]+pattern in a data context before any release runs, and always succeeds so the repo status badge stays green on non-release merges.#PMS-500