🤖 Generated by the Agentic Engineer
Evidence
Two P1s raised by Codex against #2848 at head d6401f9c, both confirmed. They are one family:
the guard resolves a command by the word written, not by what bash will actually execute.
1. hash -p rebinds a required tool. A signing block can run
hash -p /usr/bin/true cosign before an otherwise valid
cosign sign --yes --recursive "${REF}". Bash's help hash documents -p pathname as using that
pathname for the named command, so the "signing" call executes true, returns success, and
reconciliation proceeds with no signature published. The alias vector is already hardened here;
the command hash table is the same bypass through a different mechanism and is currently untracked.
2. An interpreter-wrapped workload operation is invisible. If a step invokes the wrapper as
bash ./scripts/run-ksail-prod-with-pull-auth.sh workload push, bash runs that script with those
arguments, but the matcher reads the executable as bash and omits the operation entirely. An
existing direct push then satisfies the pre-evidence marker while a second, interpreter-wrapped
push of modified manifests happens after signing and attestation — and the recognised reconcile
releases it. That is the ordering guarantee inverted while every check passes.
Why these two together
Both are "the token in the source is not the operation that runs". Fixing them separately would
restate the same missing predicate twice, exactly as the four value-assertion findings in #2870 do one
level up. The natural shape is a single command-resolution step used by every matcher: resolve what a
command word will actually execute (rejecting rebinding of a required tool) and unwrap known
interpreters (bash/sh + script path) before matching an operation.
Scope note
#2848 closes the ordering axis, the two shell-parsing bypasses, and (at 7376dfba) nameref aliasing
of a protected variable. This is the command-resolution axis and is tracked here rather than
extending a PR already well past a dozen review rounds. Sibling: #2870 (value assertions).
Acceptance criteria
Size: medium — one resolution helper, matcher call sites, and their tests.
Part of #2627. Raised on #2848.
Evidence
Two P1s raised by Codex against #2848 at head
d6401f9c, both confirmed. They are one family:the guard resolves a command by the word written, not by what bash will actually execute.
1.
hash -prebinds a required tool. A signing block can runhash -p /usr/bin/true cosignbefore an otherwise validcosign sign --yes --recursive "${REF}". Bash'shelp hashdocuments-p pathnameas using thatpathname for the named command, so the "signing" call executes
true, returns success, andreconciliation proceeds with no signature published. The alias vector is already hardened here;
the command hash table is the same bypass through a different mechanism and is currently untracked.
2. An interpreter-wrapped workload operation is invisible. If a step invokes the wrapper as
bash ./scripts/run-ksail-prod-with-pull-auth.sh workload push, bash runs that script with thosearguments, but the matcher reads the executable as
bashand omits the operation entirely. Anexisting direct push then satisfies the pre-evidence marker while a second, interpreter-wrapped
push of modified manifests happens after signing and attestation — and the recognised reconcile
releases it. That is the ordering guarantee inverted while every check passes.
Why these two together
Both are "the token in the source is not the operation that runs". Fixing them separately would
restate the same missing predicate twice, exactly as the four value-assertion findings in #2870 do one
level up. The natural shape is a single command-resolution step used by every matcher: resolve what a
command word will actually execute (rejecting rebinding of a required tool) and unwrap known
interpreters (
bash/sh+ script path) before matching an operation.Scope note
#2848 closes the ordering axis, the two shell-parsing bypasses, and (at
7376dfba) nameref aliasingof a protected variable. This is the command-resolution axis and is tracked here rather than
extending a PR already well past a dozen review rounds. Sibling: #2870 (value assertions).
Acceptance criteria
hash -pbefore the signing call.bash <script> workload <op>(andsh) is recognised as thatoperation, with a test proving a post-evidence interpreter-wrapped push is caught.
.github/actions/deploy-prod/action.ymlstill validates clean, and alegitimate
bash -cthat is not a workload operation is not misread as one.Size: medium — one resolution helper, matcher call sites, and their tests.
Part of #2627. Raised on #2848.