Security review fixes: hostile-input hardening, the runner's API host, bounded requests #17
All Vouch review confidence checks passed
Residual risk 0.34 = Change Risk (0.71) × (1 − Review Confidence (0.53)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.71 · 514 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 83% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.374
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.071
Real PR Conversation Timeline
1 comments
"Review active on #17"
general
weight: 0.35
askalf
What and why
These are the fixes from an independent security review. The threat model is a hostile audited repository. Anyone who can open a pull request controls run, job and step names. Whoever can push to the default branch, or owns a repository you audit, controls the workflow YAML. Each finding below was reproduced before it was fixed, and each has a regression test in
test/security.test.mjs.1. Slow matching.
isOnandcacheInputOnmatched/^\$\{\{\s(.?)\s\}\}$/against workflow values. A long unterminated${{made it backtrack in cubic time (2,000 spaces took 3 s; 20 KB, about an hour). In the action, that holds the runner until its 6-hour limit.wholeExpression()now uses a prefix and suffix test instead.jobNamePatternjoined literals with[\s\S](polynomial on a long, non-matching job name). It now finds the literals in order withindexOf, giving the same matches in linear time.2. Report text stays text (
src/report.mjs,src/compare.mjs,src/cli.mjs). Every string from the repository is rendered throughmd():<and>become entities and[,],\are escaped, so no HTML, hidden comment, link or tracking image;Examples are fenced with more backticks than they contain,
cell()builds onmd(), and the CLI progress line drops control characters. The HTML report was already escaped correctly.3. The runner's API host. The action and the CLI send the token to
GITHUB_API_URL(apiBase(), https only, no credentials or query), andcreateClientrefuses a non-https base. On GitHub Enterprise Server or GHE.com, the token used to go to api.github.com, and the audit read a github.com repository of the same name.4–5. Bounded requests.
?or#can't change which file or ref is read.REPO_RErejects.and..as an owner or repository name.AbortSignal.timeout) that covers the body too.content-lengthand while streaming.6. A wider injection scan.
workflow_run'sdisplay_titleand its pull requests' head refs, committer name and email, head repositorydescription.env:at workflow, job and step level, including chains, into a later${{ env.NAME }}. A variable read as"$VAR"is the fix, not a finding. A nearer scope that sets the variable again from trusted text clears it.pull_request_targetandworkflow_runjobs that run a fork's code or artifacts, composite actions, and reusable workflows in other repositories.7. Smaller items.
docs/rules.mdstate the new guarantees.Not in this PR:
publish.ymlso build and test run without publish rights. It changes the release workflow, so it gets its own PR.I re-checked against the real API: an audit of askalf/ci through a proxy runs to completion, and its report includes the coverage note.
Checks
npm testpasses (203; 13 new intest/security.test.mjs)npm run buildrun anddist/committeddocs/rules.md. The new injection fields and env flow each have positive cases and near misses (workflow_run.id,committer.date,"$VAR", a nearer trusted reassignment), anddocs/rules.mdlists them.