From 75cbfd38b05d1bdd0ac13ffb67681f34c58be857 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Mon, 22 Jun 2026 10:28:22 +0000 Subject: [PATCH] =?UTF-8?q?chore(ai-review=20=E7=8B=80=E6=85=8B):=20?= =?UTF-8?q?=E6=8E=92=E9=99=A4=20OpenCode=20TLS=20=E9=A0=90=E8=A8=AD?= =?UTF-8?q?=E8=AA=A4=E5=A0=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/ai-review/exclusions.json | 6 ++++++ .gitea/ai-review/findings.json | 10 +--------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.gitea/ai-review/exclusions.json b/.gitea/ai-review/exclusions.json index 6109716..aa579c4 100644 --- a/.gitea/ai-review/exclusions.json +++ b/.gitea/ai-review/exclusions.json @@ -386,5 +386,11 @@ "role": "Mage", "original_finding": "新加入的測試案例 `it('skips OpenCode TLS verification for empty string and non-false values', ...)` 預期 `shouldSkipOpenCodeTLSVerify()` 函式在 `OPENCODE_SKIP_TLS_VERIFY` 環境變數為空字串 `''` 或 `'0'` 時,會回傳 `true`。然而,根據常見的環境變數布林值解析邏輯,以及 `app/preflight.test.js` 中現有的相關測試(例如未設定時為 `false`,設定為 `'false'` 時為 `false`),`shouldSkipOpenCodeTLSVerify()` 函式(此 PR 未修改其內容)很可能不會將 `''` 或 `'0'` 視為 `true`。這造成了測試預期與函式實際行為之間的邏輯不一致。", "reason": "誤判。`shouldSkipOpenCodeTLSVerify` 的既有設計是只有 `OPENCODE_SKIP_TLS_VERIFY === 'false'` 才啟用 TLS 驗證;空字串與 '0' 皆屬非 'false' 值,測試符合目前明確實作與預設跳過 TLS 的行為。" + }, + { + "location": "app/preflight.test.js:201", + "role": "Assassin", + "original_finding": "此測試明確證實了 `OPENCODE_SKIP_TLS_VERIFY` 環境變數的寬鬆判斷邏輯,導致 OpenCode LLM 連線的 TLS 驗證容易被關閉。這是「關閉 TLS 驗證」的不安全預設,極大地增加了中間人攻擊的風險。", + "reason": "誤判/既有設計。OpenCode server 目前支援自簽或內部服務情境,action input 與 README 均明確標示 OPENCODE_SKIP_TLS_VERIFY 預設跳過 TLS 驗證;本 PR 只補測試與 Review comment 內容,未新增或放寬此安全行為。" } ] diff --git a/.gitea/ai-review/findings.json b/.gitea/ai-review/findings.json index 57a68c6..fe51488 100644 --- a/.gitea/ai-review/findings.json +++ b/.gitea/ai-review/findings.json @@ -1,9 +1 @@ -[ - { - "level": "critical", - "role": "Assassin", - "location": "app/preflight.test.js:201", - "suggestion": "此測試明確證實了 `OPENCODE_SKIP_TLS_VERIFY` 環境變數的寬鬆判斷邏輯,導致 OpenCode LLM 連線的 TLS 驗證容易被關閉。這是「關閉 TLS 驗證」的不安全預設,極大地增加了中間人攻擊的風險。攻擊者可以利用此漏洞,在 LLM 服務通訊中插入惡意代理,竊取敏感資料或篡改 LLM 的行為。請立即修正 `app/config.js` 中 `shouldSkipOpenCodeTLSVerify` 的邏輯,使其僅在明確意圖下才關閉 TLS 驗證。", - "is_new": true - } -] +[]