fix(verify-npm-provenance): write outputs in heredoc form (#4) - #5
Conversation
`detail` is not a fixed vocabulary — it is built from registry-supplied data (the DSSE `repository` field among others). With the plain `key=value` form a newline in that value emitted a second `status=` line into $GITHUB_OUTPUT, and GitHub resolves duplicate keys last-wins, so a `source-mismatch` could be read downstream as `ok`. Low severity as filed: it needs an attacker who already controls the registry response, and `gate` mode still fails because the exit code is computed in-process and never round-trips through $GITHUB_OUTPUT. The realistic impact is a false-healthy row in `monitor` mode (the Nimbus weekly secret-health run). Worth fixing regardless — this action exists so its verdict can be trusted. renderOutputs() is exported and uses a random per-call delimiter, so a value can never close its own block. Tests parse the result the way the runner does (heredoc blocks are literal data, later keys win) and assert the real verdict survives an injected `status=ok`. Red-proved: reverting to `key=value` fails the new test. 29/29 green via CI'\''s glob form. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 59 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|



Closes #4.
detailis not a fixed vocabulary — it is built from registry-supplied data (the DSSErepositoryfield among others). With the plainkey=valueform, a newline in that value emitted a secondstatus=line into$GITHUB_OUTPUT, and GitHub resolves duplicate keys last-wins — so asource-mismatchcould be read downstream asok.Low severity, as filed: it needs an attacker who already controls the registry response, and
gatemode still fails because the exit code is computed in-process and never round-trips through$GITHUB_OUTPUT. The realistic impact is a false-healthy row inmonitormode (the Nimbus weekly secret-health run). Worth fixing regardless — this action exists so that its verdict can be trusted.Change
renderOutputs()is exported and emits the heredoc-delimiter form with a random per-call delimiter, so a value can never close its own block and therefore can never start a line the runner would parse as a key assignment.Tests
The new tests parse the rendered output the way the runner does (a
key<<DELIMblock is literal data until a line equal toDELIM; later keys win) and assert the real verdict survives an injectedstatus=ok. My first attempt asserted on raw line counts and was wrong — the injected text does appear, correctly, as data inside the detail block.Red-proved: reverting
renderOutputstokey=valuefails the new test (3 failures); restoring it gives 29/29.Run with CI'''s glob form —
node --test "actions/**/test/*.test.js"— since a bare directory arg isMODULE_NOT_FOUNDon Node 24.🤖 Generated with Claude Code