Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

mimosa 写入门禁误报:零输入静态 SQL 的 QueryRow 形态被判注入硬拒,且该类 finding 无法铸 exclusion 锚

Offen
#59 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
38/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
go, sql
Bereich
security, tooling

Rechercherichtung

Reproduce the report with internal/data/migrate_test.go and inspect the security_scan deep output, findings.json, hook-state findingEvents, and the README-referenced CLI behavior. Compare the QueryRow static SQL finding with the exclusion identity.anchor and line_hash paths. Done means the false positive is handled or a usable exclusion anchor is emitted and verified against the listed test case.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

环境

  • ZCode Desktop 3.14.3(Windows)+ WSL 项目;插件 mimosa 1.0.3;MIMOSA_HOOK_BLOCK 默认 graded
  • 宿主语言 Go;被拦文件为集成测试 internal/data/migrate_test.go(TimescaleDB 测试夹具)

现象:静态字面量 SQL 的测试代码被判「高危 · SQL 注入」硬拒

PreToolUse 门禁将候选 diff 区域内的如下既有代码判为高危注入并 deny:

if err := st.Pool().QueryRow(ctx, `SELECT count(*) FROM metrics`).Scan(&rows); err != nil {
  • 该形态零用户输入(静态字面量、测试夹具);同文件新增的静态 INSERT 字面量全部判净放行——仅 QueryRow(ctx, \SQL`)` 形态命中
  • 门禁按候选 diff 区域判定:只要一次编辑的 old_string 覆盖到含此形态的既有行(哪怕实际改动与 SQL 无关),整个写入被硬拒。项目里既有测试大量含此形态,导致这些文件事实上不可编辑,只能靠收窄编辑锚点绕行

工具面缺口(误报无法自救)

  1. exclusion 锚只能用深扫 findings.json 的 identity.anchor,但 security_scan(deep,含 focusFiles 指向该文件)不产出任何 *_test.go finding——门禁误报无锚可铸
  2. hook-state findingEvents 的 line_hash 与 exclusion anchor 派生不同源。同一 finding 实证:line_hash e75974d4… ≠ anchor 64a7244…(deploy.go 命令注入)。用 line_hash 铸 exclusion 条目无效(已实测,仍拦)
  3. README 提及的 mimosa scan <file> 单文件 CLI 未随插件分发(PATH 与 ~/.zcode/mimosa-zcode/ 均无),无第三条铸锚路径

期望

  • 静态字面量 SQL(尤其测试文件)不判注入
  • 或:门禁拦截输出 / hook-state 附带可铸的 identity.anchor;或 exclusions 支持 line_hash / file+line 形态

附带观察(可能属宿主而非插件,供参考)

Windows 桌面启动 + WSL 项目形态下 MIMOSA_HOOK_BLOCK 传值不达:registry 用户级配置正确、宿主完整重启后,WSLENV 名单到达 WSL 侧 server 进程而变量值未达,ask 模式无法启用(该形态下 zcode-server 经 /init 直拉、不加载 shell rc,WSLENV 是唯一通道)。

Vorherrschende Sprache
Python
Sterne
103
Forks
78
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus zai-org/zcode-plugins

Alle Issues in zai-org/zcode-plugins

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.