Repository navigation
ci: harden lane-line's error annotation against body-content injection - #637
Conversation
Copilot review finding on the sibling adoption PRs (codexFactory #190, xFactory #231, openXwallet #15): the ::error annotation interpolated the untrusted PR-body first line ($first) directly into the workflow command message, which GitHub Actions percent-decodes — a crafted body line could inject additional workflow commands into the runner log. The annotation is now fully static; the offending line is still surfaced, via a plain echo before the annotation instead of inside it. Also fixes the exemption comment: it said "bots are exempt by ACTOR" but the condition keys on github.event.pull_request.user.type, the PR AUTHOR, not the actor. Reworded to say PR AUTHOR type explicitly. This is the appendix errata for lane-collision-protocol-amendment-1.md's Rule 8 appendix, applied to the copy already merged here as #631 (b1d492a). Lane: openxfactory-f2 Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01KeBPLWRL4rhgRbmjP8Li41
There was a problem hiding this comment.
Hi @brettheap! 👋
Your private repo does not have access to Sourcery.
Please upgrade to continue using Sourcery ✨
There was a problem hiding this comment.
🟢 Approval recommended
The change correctly removes untrusted interpolation from workflow-command annotations while preserving safe diagnostics and does not introduce behavioral regressions.
Pull request overview
This PR hardens the lane-line GitHub Actions workflow against GitHub Actions workflow-command injection by ensuring that untrusted PR body content is never interpolated into an ::error annotation message.
Changes:
- Removes interpolation of the first non-empty PR body line from the
::errorworkflow command message, making the annotation fully static. - Logs the offending first non-empty body line via a plain
echoprior to emitting the::error, preserving debuggability without command injection risk. - Updates the bot-exemption comment to accurately describe the condition as based on PR author type (
github.event.pull_request.user.type).
File summaries
| File | Description |
|---|---|
| .github/workflows/lane-line.yml | Makes the error annotation message static and adjusts logging/comment wording to avoid untrusted content interpolation. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Lane: openxfactory-f2 Provenance for the admin merge. RULING for lane openxfactory-f2's PR #637 (head |
Lane: openxfactory-f2
What this is
Errata for the
lane-lineworkflow (Amendment 1, Rule 8) already mergedhere as PR #631 (
b1d492a3). Copilot's automated review on the threesibling adoption PRs — codexFactory
#190, xFactory
#231, openXwallet
#15 — flagged two
findings against the identical file those PRs vendored from this repo's
appendix. Both are TAKEN there and here.
Finding 1 — the
::errorannotation interpolated untrusted body contentThe original
run:step built:$firstis the PR body's first non-empty line — untrusted input. GitHubActions workflow commands percent-decode their message payload (
%0A,%0D,%25), so a crafted body line could inject additional workflowcommands into the runner log via this annotation. Fix: the annotation
message is now fully static (no interpolation at all), and the offending
line is still surfaced — via a plain
echoprinted before theannotation, not inside it:
The plain
echois safe from the same class of issue because it is alwaysprefixed with
"lane-line: first non-empty body line was: ", so theprinted line can never itself begin with
::regardless of$first'scontent, and
$firstcannot contain an embedded newline (it is extractedby
sed -n '/[^[:space:]]/{p;q;}', which returns exactly one line).The annotation still cites Rule 5 — that is deliberate, not a residual
bug: Rule 5 is the substantive convention this check enforces (the PR
body must open with
Lane: <name>); Rule 8 is the enforcement mechanismitself. The appendix text is unchanged on that point.
Finding 2 — the exemption comment misnamed the condition
The comment said "Bots are exempt by ACTOR", but the
if:condition keyson
github.event.pull_request.user.type— the PR author, not theworkflow-run actor (which can differ, e.g. on
synchronizepushed by ahuman to a bot-opened PR, or vice versa). Reworded to say PR AUTHOR type
explicitly:
The
if:condition itself is unchanged — only the comment now matches it.Local verification
Re-ran the five local logic cases from PR #631's own verification, against
the patched
run:script extracted verbatim (BODYset via environment,exactly as the workflow invokes it):
BODYLane: openxfactory-f2\n\n## xlane-line OK: Lane: openxfactory-f2\nLane: repo-shape (second window)lane-line OK: Lane: repo-shape (second window)## What is proposed::error<empty>), then static::errorLane: Openxfactory_F2::errorAll five match.
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/lane-line.yml'))"also passed.
lane-linePASSED on this PR's own head (this PR body openswith
Lane: openxfactory-f2), and PASSED on the re-pushed heads of allthree sibling PRs after the identical patch was applied there.
Byte identity note
This patch is applied identically to the copy already merged here (this
PR) and to the copies in the three sibling repos' open adoption PRs. The
appendix in
~/agents/protocols/lane-collision-protocol-amendment-1.mdis recorded by the orchestrating session as carrying this errata going
forward — this PR is the code-side landing of that correction in
openxFactory.
Adoption note
Unchanged from #631: this does not make
lane-linerequired. That remainsBrett's console act.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KeBPLWRL4rhgRbmjP8Li41