Skip to content

regression-gate.sh:baseline language 欄位未驗證即入 worklist TSV(follow-up from #109 verify) - #114

Merged
kiki830621 merged 1 commit into
mainfrom
idd/112-regression-gate-sh-baseline-language-wor
Jul 30, 2026
Merged

regression-gate.sh:baseline language 欄位未驗證即入 worklist TSV(follow-up from #109 verify)#114
kiki830621 merged 1 commit into
mainfrom
idd/112-regression-gate-sh-baseline-language-wor

Conversation

@kiki830621

Copy link
Copy Markdown
Member

Refs #112

Summary

scripts/regression-gate.sh 的 worklist 生成對 baseline.jsoncorpus 欄位有 charset 白名單,但 language 欄位裸寫入同一份 line-oriented TSV(下游 while IFS=$'\t' read -r corpus language 行導向解析),embedded \n 可偽造一筆 corpus 未經驗證的 worklist 記錄(#109 verify security lens MEDIUM-1,PoC 以 corpora/../ 相對路徑逃出 $DEST)。本修對 language 加與 corpus 同款的 re.fullmatch(r"[a-z]{2,3}(-[A-Za-z0-9]+)?") 白名單,不符即 fail-loud。

Verification

TDD:test harness 抽出 gate 真實的 worklist heredoc 對 fixture 執行。

  • RED(unpatched):malicious fixture 讓 corpora/../evil 偽造 row 混入 + exit 0(注入成立)
  • GREEN(patched):malicious fail-loud exit 非零、無偽造 row;benign 現行 baseline 12 entries 照常輸出 12 行不變
  • bash -n 語法通過

Checklist


Generated by /idd-implement on PR path. Do NOT add a GitHub close trailer — IDD discipline requires manual /idd-close after merge.

worklist 生成對 corpus 有 charset 白名單但 language 裸寫入同一份
line-oriented TSV,embedded \n 可偽造一筆 corpus 未經驗證的 worklist
記錄(#109 verify security lens,PoC 以 corpora/../ 逃出 $DEST)。加與
corpus 同款的 re.fullmatch([a-z]{2,3}(-[A-Za-z0-9]+)?) 白名單,fail-loud。

Refs #112
@kiki830621

Copy link
Copy Markdown
Member Author

Verify Report — PR #114 (#112)

Engine

manual fan-out (4 lens Agents + sequenced DA, model: opus, file-based output) + Codex (gpt-5.x) — Codex leg incomplete this round(HTTP 429 usage_limit_reached,ChatGPT Pro plan,約 5.5 天後 reset)。跨模型盲驗本輪缺席,記為 fail-closed INFO,當 PASS 計。5 個 Claude reviewer(4 lens + DA)仍完整。

Aggregate

PASS — 0 blocking, 3 follow-up (filed), 1 process-gap (codex leg)。

#112 stated scope(對 language 欄位加 re.fullmatch 白名單、堵 worklist TSV newline-injection)verifiably complete。5 個 Claude reviewer 一致 PASS,DA 認真嘗試後無法推翻核心判定。

要求覆蓋率

1 / 1 requirement addressed — FULLY。

Findings(合併後)

# Severity Finding Source Action
1 PASS language 白名單 re.fullmatch(r"[a-z]{2,3}(-[A-Za-z0-9]+)?") 已加、regex 與 issue 提案逐字一致、re 既 import;empirically 拒 #109 PoC payload + 30+ 向量(LF/CRLF/NUL/VT/NEL/NBSP/U+2028/homoglyph);security lens 窮舉全 1,114,112 Unicode codepoint 確認零非 [A-Za-z0-9-] 字元可通過 agents:requirements+logic+security
2 PASS re.fullmatch trailing-newline bypass(不同於 re.match(pat+"$")'en\n' → match+$=True 但 fullmatch=False)——修復「因正確的結構性理由而正確」 agents:logic+devils-advocate
3 PASS fail-loud 位置正確:sys.exit(L61)在 print(L62)之前。實測把 hostile entry 放第 3 筆仍 exit 1、stdout 空、benchmark subprocess never ran、forged row 不入 worklist.tsv agents:requirements+logic+regression+devils-advocate
4 PASS 無 regression:現行 baseline 12 entries(en/ja/zh ×4)全過;pre/post-fix worklist sha256 相同e3f18b26…)、12 行 rc=0 agents:regression
5 PASS 無 scope creep:+9/−1 單檔單 hunk(commit e80f3de),未動 model-pin block / STANDARD_GAPS / baseline-compare.py / spec agents:regression
6 MEDIUM model 欄位是同一 bug 隔壁一欄——未驗證即進 path sink(L80 cd "$MODEL_DIR")+ CLI arg(L162 --models)。3 個獨立 reviewer 各自 live 重現 ../../../ traversal 逃出 cache root。#112 沒移除 path-traversal capability,只把 payload 從 language 移到 model agents:logic(A1)+security(H1)+devils-advocate Follow-up → #115
7 MEDIUM worklist 階段無 test 覆蓋grep worklist Tests/ 零命中);未來 heredoc refactor 可能靜默掉白名單,#112/#115 就此回歸 agents:regression+security Follow-up → #116
8 LOW baseline-compare.py L48/L53 把 metric(驗證於何處皆無)未跳脫印 CI stdout;DA 從 committed baseline(無 TOCTOU)重現 CR+ANSI log-spoofing(偽造綠色「全過」) agents:devils-advocate Follow-up → #117
9 LOW 非字串 language(JSON 123/null)拋 TypeError traceback 而非 curated gate-error;但 fail-closed、與既有 corpus 檢查同 neighborhood,一致 agents:regression+security Noted (won't-fix,一致性優先)
10 INFO cross-model(gpt-5.x)盲驗本輪缺席(Codex 429)——ensemble 降為 5-AI 單模型家族 codex Process Gap

Scope Check

無超出 issue #112 範圍的改動。合併後所有 PASS finding 一致確認單檔單點修。

Process Gaps

Follow-up Findings Filed (v2.72.0+ #148)

紀律聲明

#112 通過驗證,可 merge PR #114/idd-close #112close note 必須限縮 scope 為「language 欄位 TSV injection 已堵」,不得宣稱「baseline.json injection 全堵」——model#115)、metric#117)是同一 residual class 的兩個 live instance,已各自 file、非本 PR blocker。

@kiki830621
kiki830621 merged commit 65c0f64 into main Jul 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant