Semgrep pip install in the Action runs unhashed with the job token in its env
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
调研方向
阅读 .github/scanners/install.sh 第 99–103 行附近以及 action.yml 第 79–88 行和第 180–192 行附近的内容;将令牌的使用方式与 docs/ci.md 及相关工作流进行比较。先检查安装步骤如何传递 GH_TOKEN,以及 Semgrep 是如何安装的。完成标准是:安装 Semgrep 时不接收令牌,且输入描述准确说明其 PyPI 版本固定方式;运行列出的简短测试和 lint 检查。
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- Go
- 星标
- 0
- 派生
- 1
- 平均合并
- 8 小时 14 分钟
- 30 天内合并 PR
- 3
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
TMHSDigital/Spackle 的其他 Issue
-
ci good first issue severity: low
难度 2/5 1-3 小时 新手友好度 77/100
TMHSDigital/Spackle#206 ·
维护者通常 1 天内回复
-
bug good first issue severity: low
难度 2/5 1-3 小时 新手友好度 82/100
TMHSDigital/Spackle#199 ·
维护者通常 1 天内回复
-
bug good first issue severity: low
难度 2/5 1-3 小时 新手友好度 87/100
TMHSDigital/Spackle#195 ·
维护者通常 1 天内回复
-
documentation good first issue severity: medium
难度 1/5 1 小时以内 新手友好度 90/100
TMHSDigital/Spackle#188 ·
维护者通常 1 天内回复
-
documentation good first issue severity: medium
难度 2/5 1-3 小时 新手友好度 84/100
TMHSDigital/Spackle#187 ·
维护者通常 1 天内回复
查看 TMHSDigital/Spackle 的全部 Issue
相似的 Issue
-
bug effort:s impact:med raised-by:worker risk:low to:worker
难度 2/5 1-3 小时 新手友好度 78/100
medici-finance/assay#8120 · 1 条评论 ·
维护者通常 1 天内回复
-
factory:subtask
难度 1/5 1 小时以内 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
agent-substrate/substrate#4308 ·
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
celestiaorg/celestia-app#8877 ·
维护者通常 1 天内回复
-
sweep
难度 1/5 1 小时以内 新手友好度 84/100
bketelsen/truenas-mcp#112 ·
维护者通常 1 天内回复