verify-action-build: end run: block at sibling keys like env: - #1105
verify-action-build: end run: block at sibling keys like env:#1105potiuk wants to merge 1 commit into
Conversation
The run: block tracker only closed a block scalar on keys indented less than 8 spaces, so an `env:` sibling and everything after it were scanned as shell body. Binding an input to an env var is the recommended way to keep it out of the script text, so the check reported the mitigation as the injection: carabiner-dev/actions@60563b5 raised 19 shell findings, all false, while reviewing #1076. Track the indent of the run: key instead and close the block at any content indented no deeper. Single-line `run: cmd` is now scanned on its own line rather than swallowing the keys that follow it. Generated-by: Claude Opus 5 (1M context) via Claude Code
|
Fresh evidence for this one: the false positive fired again today on #1109 The CI verify job reported: Line 80 of that action.yml is: That is the env: mapping, i.e. exactly the mitigation this check is meant to The cause is the boundary logic this PR replaces: on main, security.py:983 Every carabiner-dev install/* and download-and-verify bump has this shape, so |
|
🙏 |
Follow-up from reviewing #1076.
analyze_action_metadataclosed arun:block scalar only on keys indented less than 8 spaces, so a siblingenv:(and everything after it) was scanned as shell body.direct input interpolation (injection risk)check reported the mitigation as the flaw:carabiner-dev/actions/install/download-and-verify@60563b5raised 19 shell findings, all false.run:key and closes the block at any content indented no deeper. Single-linerun: cmdis scanned on its own line instead of swallowing the keys that follow it.Test plan
utils/tests/verify_action_build/test_security.py; the fixture is the realdownload-and-verifyaction.yml shape. Two of the three fail without thesecurity.pychange.uv run pytest utils/tests/- 310 passed.prek run --all-files- clean.verify_action_build --from-pr 1076now reports 2 shell findings instead of 19 and no injection warning. TheGITHUB_PATHwrite on the single-linerun:at line 177 is newly detected, which the old boundary logic skipped.Generated-by: Claude Opus 5 (1M context) via Claude Code