Semgrep pip install in the Action runs unhashed with the job token in its env
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Read .github/scanners/install.sh around lines 99–103 and action.yml around lines 79–88 and 180–192; compare the token use with docs/ci.md and the related workflow. Start by checking how the install step passes GH_TOKEN and how Semgrep is installed. Done when Semgrep installation does not receive the token and the input description accurately explains its PyPI version pin; run the listed short tests and lint checks.
Written by the indexing model from the issue text.
Description
Summary
The Action's scanner install step sets the job token for the whole step, including the pipx install of Semgrep, which is pinned by version only. The scanners input description also says every download is hash-checked, which is not true for Semgrep.
Where
action.yml:180-192(install step withGH_TOKEN).github/scanners/install.sh:99-103(pipx install --force "semgrep==<version>")action.yml:79-88(scannersinput description).github/workflows/scanners.yml:42-49
Details
The token is needed only by gh release download for the four release-file scanners. For Semgrep only the top-level version is pinned; its dependency tree is resolved from PyPI on every run, which .github/scanners/pins.env and docs/ci.md state openly. The step-wide environment means that install also sees the token. The description in action.yml says "Each download is checked against its pinned hash before it is installed"; docs/ci.md has the accurate wording.
Impact
Hardening: a consumer who sets scanners: semgrep or scanners: all gives the workflow token to a step that runs code it has not pinned by hash, in a step whose description says everything is hash-checked. The four release-file scanners are not affected.
Suggested fix
Run the pipx install without the token (env -u GH_TOKEN -u GITHUB_TOKEN ... pipx install ... in install.sh). Better, install from a committed requirements file with hashes (pip install --require-hashes -r semgrep.lock into a venv) so the whole tree is pinned like the other four scanners. Correct the scanners description in action.yml to say that Semgrep is installed from PyPI by version.
Acceptance criteria
- The Semgrep install does not have the token in its environment
-
action.ymldescribes the Semgrep install accurately - Optional: a hash-locked requirements file, checked by the weekly tool-versions job
Related: #106
Getting started
- Relevant files: .github/scanners/install.sh, action.yml, .github/scanners/pins.env
- How to run tests:
make test-short(Unix) or.\make.ps1 test-short(Windows PowerShell);make lintbefore you call it done - Related docs: docs/ci.md (External scanners)
Filed by repo-audit/full-audit at 50e92ec. Severity: low. Effort: S. audit-key: ci|.github/scanners/install.sh|semgrep-token-env
- Dominant language
- Go
- Stars
- 0
- Forks
- 1
- Avg merge
- 8h 14m
- Merged PRs (30d)
- 3
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from TMHSDigital/Spackle
-
ci good first issue severity: low
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
TMHSDigital/Spackle#206 ·
Maintainers usually reply within 1 day
-
bug good first issue severity: low
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
TMHSDigital/Spackle#199 ·
Maintainers usually reply within 1 day
-
bug good first issue severity: low
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
TMHSDigital/Spackle#195 ·
Maintainers usually reply within 1 day
-
documentation good first issue severity: medium
Difficulty 1/5 Under an hour Newbie friendliness 90/100
TMHSDigital/Spackle#188 ·
Maintainers usually reply within 1 day
-
documentation good first issue severity: medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
TMHSDigital/Spackle#187 ·
Maintainers usually reply within 1 day
All issues in TMHSDigital/Spackle
Similar issues
-
bug effort:s impact:med raised-by:worker risk:low to:worker
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
medici-finance/assay#8120 · 1 comment ·
Maintainers usually reply within 1 day
-
factory:subtask
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
agent-substrate/substrate#4308 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
celestiaorg/celestia-app#8877 ·
Maintainers usually reply within 1 day
-
sweep
Difficulty 1/5 Under an hour Newbie friendliness 84/100
bketelsen/truenas-mcp#112 ·
Maintainers usually reply within 1 day