Skip to content

fix(ci): verify the sealer copy before the implement lane runs it - #16705

Merged
kyle-sexton merged 2 commits into
mainfrom
fix/verify-sealer-copy
Nov 17, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
fix/verify-sealer-copy

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: hardening found during a workflow review

Summary

The run job in pr-run-activity-read.yml copies the output sealer (action.yml, seal.mjs) and the scan-carrier public key from the base before the head checkout, then runs that copy with uses: ./.lane-seal. This PR verifies the integrity of that copy before it is used, the same way the job already checks its act-turns and merge-base script copies.

Fix

  • The copy step (now id: seal-copy) records the SHA-256 of each of the three files as step outputs, before the head checkout.
  • A new step, seal-check, sits between the carry step and the seal step. It checks each file in .lane-seal is a regular file whose SHA-256 matches the recorded value; on an empty hash, a missing or non-regular file, or a mismatch it emits an ::error:: annotation and fails.
  • The seal step now also requires steps.seal-check.outcome == 'success', so it does not run on a failed check. The step comments now say the copy is verified before use.

Verification

  • node --test --test-concurrency=4 on callers.test.mjs, seal.test.mjs, open.test.mjs, log-api-budget.test.mjs, credential-legs.test.mjs and lane-transcripts/pull.test.mjs: 425 pass, 0 fail. The new test pins the step order (copy before the head checkout; carry, check, seal adjacent), the if expressions, and that each hash the check reads is one the copy step writes; it runs the copy step on a base, then the check on a clean copy (passes) and on each file rewritten, removed or replaced by a link, and on each empty hash (each fails with an error annotation).
  • actionlint on the workflow: no findings. zizmor --offline on the workflow: no findings.
  • Left out: the full .github suite (CI runs it).

Related

N/A

🤖 Generated with Claude Code

kyle-sexton and others added 2 commits November 17, 2026 01:17
The run job copies the output sealer and its public key from the base
before the head checkout. The copy step now records each file's SHA-256,
and a new step between the carry and the seal checks the copy in
.lane-seal against those hashes, failing with an error annotation and
skipping the seal step on any mismatch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 17, 2026 06:21
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T06:23:02.994070Z 8447500 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 84475000e4bcfbacdf6ab117caa18d4bb7376538: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #16705, verify the sealer copy before the seal step runs it

No security issues found.

I read the whole change in both files: .github/workflows/pr-run-activity-read.yml (a trusted path) and .github/actions/resolve-config/callers.test.mjs.

What the change does. The copy step (now id: seal-copy) runs before the head checkout. It records the SHA-256 of three base files as step outputs: action.yml, seal.mjs and scan-carrier.pub. A new seal-check step runs after the carry step and checks that each file in $GITHUB_WORKSPACE/.lane-seal is a regular file, not a symlink, and matches its recorded hash. The seal step now also requires steps.seal-check.outcome == 'success'.

Trust-control check. seal-lane-output controls what untrusted text reaches a lane. This change only narrows it:

  • Before this change, the seal step ran whatever copy head code left in RUNNER_TEMP. Now it runs only a copy that matches the base.
  • Head code cannot change the recorded hashes. The outputs are written to $GITHUB_OUTPUT and committed while seal-copy runs, which is before head code runs, and a later step cannot rewrite an earlier step's outputs.
  • The check fails closed. An empty hash, a missing file, a symlink or a mismatch each exits 1, and then the seal step is skipped.
  • Nothing else is touched: no permissions: change, no token request, no trigger change, no new secret exposure.

Residual risk, not counted as a finding. Head code runs in the same job, so a background process it started could still rewrite .lane-seal in the moment between seal-check and uses: ./.lane-seal. That risk existed before this PR, the PR does not widen it, and the existing comment on the copy step notes that a forged sealer gains nothing the model job does not already hold. The act-turns script copy is already checked the same way.

Other notes.

  • No owner friction hold is weakened.
  • No plugin manifest is touched.
  • The PR description contains no embedded instructions.
  • The change spends no API credits and can cause no charge.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 84475000e4bcfbacdf6ab117caa18d4bb7376538: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Code review: no findings

This PR hardens the run job in .github/workflows/pr-run-activity-read.yml. The copy step (now id: seal-copy) records the SHA-256 of action.yml, seal.mjs and scan-carrier.pub from the base before the head checkout. A new seal-check step, placed between carry and seal, checks that each file in .lane-seal is a regular file whose hash matches the recorded one. The seal step now runs only when seal-check succeeds.

What I checked (by reading the code; I ran nothing):

  • Step order and conditions. seal-copy runs before head code. seal-check runs under the same always() && steps.carry.outcome == 'success' condition that seal used before, so a run refused by write-issue still gets its lane.json checked and sealed.
  • What a failed check does downstream. When the check fails, seal is skipped and steps.seal.outputs.sealed-length is empty. The scan job's steps already require needs.run.outputs.carry-sealed-length != '' (L2756). A skipped seal therefore degrades the same way a failed seal did, and the job still fails visibly through the check's exit 1.
  • The shell. ${sum%% *} strips the - that sha256sum prints after the hash. ${!want} (bash indirect expansion) is valid under the runner's default bash shell. An empty recorded hash is refused before any compare.
  • The sealer's dependencies. seal.mjs imports only node: builtins, and the composite action.yml runs only node "$GITHUB_ACTION_PATH/seal.mjs". Hashing these three files covers all the code the sealer runs from .lane-seal.
  • The test. createHash, symlinkSync, mkdtempSync, runStep, outputLines, ACTIONS and tempDir are all imported or defined in callers.test.mjs. The test pins the step order and the if expressions. It ties each hash the check step reads to an output the copy step writes. It covers a clean copy, plus each file rewritten, removed or replaced by a symlink, plus each empty hash. A regression in the check would fail this test.

The author says the test suites pass and that actionlint and zizmor report nothing. I did not verify either claim.

Not covered here. Whether a process left behind by head code could change .lane-seal between the check and the seal, or whether head code could redirect node through GITHUB_PATH, is a question about the trust boundary. It belongs to the security-review lane that runs on this repository, not this one.

Closing issue: none (the PR says it is hardening found during a workflow review), so there are no acceptance criteria to check.

Spend: none beyond an existing CI job that now runs one extra short shell step.

Verifier dropped 0 of 0 candidates.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit d8d7fcd Nov 17, 2026
83 checks passed
@kyle-sexton
kyle-sexton deleted the fix/verify-sealer-copy branch November 17, 2026 06:56
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant