Repository navigation
Commit 7792c3d
authored
docs+ci: download fork-comment artifact to runner.temp (CodeQL artifact-poisoning) (#146)
## Why
varlock adopted the 1.18 `workflow_run` fork-comment split
([varlock#840](dmno-dev/varlock#840)) and CodeQL
flagged the poster with a **critical** `actions/artifact-poisoning`
alert. The recommended `bumpy-comment.yaml` (and our dogfood copy)
downloads the untrusted artifact into `./bumpy-comment` — i.e. *inside*
`GITHUB_WORKSPACE`, alongside the trusted checkout. CodeQL's
recommendation is to "extract artifacts to a temporary folder so they
cannot override existing files."
bumpy's own repo has no CodeQL workflow, so neither the dogfood poster
nor the docs template was ever analyzed — varlock (which runs CodeQL
Actions analysis) was the first to surface it.
## What
- **`docs/github-actions.md`** — the recommended poster now downloads to
`${{ runner.temp }}/bumpy-comment` (outside the checkout) and reads
`--body-file "$RUNNER_TEMP/bumpy-comment/comment.md"`.
- **`.github/workflows/bumpy-comment.yaml`** (dogfood) — same change;
dropped the now-moot "download after checkout or it gets wiped" note
since temp is outside the workspace.
- **Safety-rule callout** — documents *why* (untrusted artifact can't
overwrite trusted files) and adds a short note that CodeQL's
`actions/artifact-poisoning` query may flag the step: the temp-dir
download addresses its core recommendation, and if a strict variant
still flags it, it's a dismissable false positive (body used only as
comment text; PR resolved from the trusted `workflow_run` event, never
the artifact).
The upload side (unprivileged render step) intentionally keeps
`./bumpy-comment` — only the privileged download moves to temp.
## Notes
Docs + a dogfood workflow comment/path change. No behavior change to the
comment that gets posted. The `runner.temp` path is outside
`GITHUB_WORKSPACE` on hosted runners, so the trusted checkout (read for
the pinned bumpy version) is untouched.1 parent f059f8e commit 7792c3d
2 files changed
Lines changed: 11 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | | - | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | | - | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
93 | | - | |
| 95 | + | |
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
| |||
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
102 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
103 | 107 | | |
104 | 108 | | |
105 | 109 | | |
| |||
0 commit comments