Skip to content

fix(research): pass workflow inputs via env — apostrophe bug and script injection - #960

Open
emooreatx wants to merge 1 commit into
mainfrom
research/workflow-injection-fix
Open

fix(research): pass workflow inputs via env — apostrophe bug and script injection#960
emooreatx wants to merge 1 commit into
mainfrom
research/workflow-injection-fix

Conversation

@emooreatx

Copy link
Copy Markdown
Contributor

Untrusted workflow_dispatch inputs were interpolated directly into run: blocks.

The reported failure

line 3: syntax error near unexpected token `open'
##[error]Process completed with exit code 2

printf '%s' '${{ inputs.overrides_manifest }}' puts the manifest inside a single-quoted shell string. A manifest is free prose describing an experiment, so an apostrophe is close to inevitable — "the run's signed manifest" closed the quote early and the rest parsed as shell, which is why the error points at open from the next line's python3 -c.

The researcher sees a syntax error and reasonably concludes their JSON is malformed. It was valid. And the JSON-validity check downstream never ran — it was mangled by the same broken quoting. The step validating the input was defeated by the input it was validating.

The security half

The same surface is script injection: a manifest containing '; curl … | sh; ' would have executed on the runner with the provider API key in scope.

Verified both ways:

apostrophe injected echo PWNED
old (interpolated) dies, rc=2
new (via env:) parses intact does not execute

Scope

Audited the whole file rather than the one line that broke — provider, model and languages were interpolated the same way in four other places. Zero inputs.* now appear in any run: block.

Workflow-only change; no engine or adapter code.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RBWhDYiDHNEbxp7WHx8dTt

…pt injection

Untrusted workflow_dispatch inputs were interpolated directly into run: blocks.
An apostrophe in overrides_manifest broke the quoting and failed the step that
validates it; the same surface would have executed injected shell with the
provider API key in scope. All inputs now pass through env:.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RBWhDYiDHNEbxp7WHx8dTt
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

emooreatx added a commit that referenced this pull request Aug 1, 2026
PR #890 was DIRTY, so GitHub could not build a merge commit and NO checks were
running on the branch at all. That is why Build and Deploy had not run on the
last four commits: not a flaky runner, a conflicted PR silently withholding CI.

The conflict is the squash-merge of #958 (44e1435), which landed the four
research-capture files on main as one commit while release/2.9.7 had evolved
the same files further.

Resolved in favour of release/2.9.7's copy, which is strictly newer: it carries
the env: passing of overrides_manifest (the apostrophe fix AND the
script-injection close, #961) and the OVERRIDES hook. Taking main's version
would have REGRESSED the injection fix — main's copy still interpolates
untrusted input into a run: block, which is what PR #960 exists to fix.

Verified after resolution: manifest passed via env:, zero inputs.* remaining in
any run: block, workflow parses.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RBWhDYiDHNEbxp7WHx8dTt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant