Skip to content

v0.5.4 — 第三輪:修法又長出三個新缺陷 Round three: the fixes did it again

Choose a tag to compare

@tingyulu tingyulu released this 20 Aug 06:46
· 27 commits to main since this release

第三輪送審,抓到的仍然全是「上一輪修法帶出來的」🔁🔁

  1. 可預測的暫存檔名:上一輪為了「原子落檔」而用的 .ai-review.<pid>.tmp,別人可以先在共用落檔目錄放一個同名 symlink,寫入時就跟著它把別的檔案截斷。改用 mktemp 產生不可預測檔名並 chmod 600 —— 回歸測試直接放一個惡意 symlink,驗受害檔沒被寫穿。
  2. 兩個安靜的假成功{ …; cat X; printf '\n'; } > f 只要最後一個 printf 成功,整組就回 0。於是「送出殘缺的 prompt」和「存下被截斷的審閱結果」都會被判成成功。兩處都改成群組內 && 串接。
  3. 過寬比對復發:裸的 401(登入偵測與後端分類器各一份)會命中 session expires in 401 seconds,讓真失敗被判成「略過」並 exit 0。收窄成 http 401status 401401 unauthorized⚠️ 第一次修還修錯(改成 "401 " 仍會命中「401 seconds」),是回歸測試自己抓出來的。

契約也對齊了:dump_backend_output 只印尾 20 行(文件原本寫「都照印」),並警告該輸出可能含 secrets;落檔權限改 600。

驗證:5 種 shell × 41 項全過(新增 6 項:symlink 攻擊、落檔權限、401 誤判正反例…),真實 Codex 路徑重驗。

誠實註記:這輪只有 GPT 一腿,Gemini 的免費額度當日用盡(TerminalQuotaError,free tier 每日 20 次)。

Round three: the fixes did it again 🔁🔁

Every finding this round came from round two's fixes: a predictable temp filename that made "atomic save" symlink-attackable, two silent false successes ({ …; cat; printf; } > f — a trailing printf masks a mid-group failure), and a bare 401 match that turned real failures into "skipped, exit 0". The first attempt at narrowing that last one was itself wrong, and the regression suite caught it.

The takeaway after three rounds: a fix is a change, and it needs reviewing like any other change. 41 regression cases across 5 shells are now the receipt.

更新 Update: npx skills update