evolver icon indicating copy to clipboard operation
evolver copied to clipboard

待确认安全问题:Semgrep 静态扫描发现代码安全候选项

Open bjw9808 opened this issue 5 months ago • 1 comments

状态:待确认安全问题,来源是本地静态安全扫描工具 Semgrep OSS 1.167.0。 说明:这不是已确认漏洞结论,需要仓库 owner 结合运行路径、测试夹具、文档样例和部署方式人工确认。 扫描时间:2026-06-21。 扫描范围:tracked-only 快照,只扫描 Git 跟踪文件;未扫描未跟踪文件、.env、缓存、node_modules、agent 临时文件。 仓库:EvoMap/evolver 本地路径:/Users/jianwei.bao/Desktop/workinginEvoMap/evolver

摘要

  • Semgrep 候选数量:11
  • ERROR:11
  • WARNING:0
  • INFO:0

按严重级别统计

项目 数量
ERROR 11

按规则统计

项目 数量
javascript.lang.security.detect-child-process.detect-child-process 11

明细

级别 规则 文件 行
ERROR javascript.lang.security.detect-child-process.detect-child-process scripts/build_binaries.js 120
ERROR javascript.lang.security.detect-child-process.detect-child-process scripts/suggest_version.js 27
ERROR javascript.lang.security.detect-child-process.detect-child-process src/gep/gitOps.js 17
ERROR javascript.lang.security.detect-child-process.detect-child-process src/gep/selfPR.js 226
ERROR javascript.lang.security.detect-child-process.detect-child-process src/gep/selfPR.js 245
ERROR javascript.lang.security.detect-child-process.detect-child-process src/gep/selfPR.js 253
ERROR javascript.lang.security.detect-child-process.detect-child-process src/gep/selfPR.js 352
ERROR javascript.lang.security.detect-child-process.detect-child-process src/gep/selfPR.js 376
ERROR javascript.lang.security.detect-child-process.detect-child-process src/gep/selfPR.js 385
ERROR javascript.lang.security.detect-child-process.detect-child-process src/gep/validator/sandboxExecutor.js 222
ERROR javascript.lang.security.detect-child-process.detect-child-process src/ops/lifecycle.js 36

建议确认

  1. 先确认 ERROR 级别是否真实可控、是否处于生产/CI/发布路径。
  2. 对 command injection、GitHub Actions shell injection、SQL/路径/SSRF/XSS 类规则优先做数据流确认。
  3. 对 benchmark、fixture、demo、文档样例中的命中可以标记为测试/样例并考虑加局部忽略。

bjw9808 avatar Jun 21 '26 13:06 bjw9808

Triaged — confirmed intentional, not a vulnerability. All 11 detect-child-process hits are evolver's process-orchestration layer, and the only security-sensitive one is gated:

  • scripts/build_binaries.js, scripts/suggest_version.js — build/release tooling (developer-run, not in the runtime path).
  • src/gep/gitOps.js, src/gep/selfPR.js, src/ops/lifecycle.js — invoke git / gh / node with internally-constructed argument vectors (no untrusted shell interpolation); core to rollback, blast-radius, and self-PR.
  • src/gep/validator/sandboxExecutor.js — the sandbox executor's whole purpose is to run candidate commands, and every one passes through parseCommand() + assertNodeCommandSafe() before spawn.

detect-child-process is an awareness rule (it flags the presence of child_process, not a data-flow into an injection sink); there is no command-injection sink among these. No Semgrep gate runs in CI here, so no blanket suppression file is added (it would over-silence the security-critical sandbox file). If you wire Semgrep into CI, mark these sites with inline // nosemgrep: javascript.lang.security.detect-child-process.detect-child-process. Reviewed / no action needed.

autogame-17 avatar Jun 22 '26 18:06 autogame-17