Repository navigation
fix(permission): case-insensitive switch_mode escalation gate (#4260) - #4263
Merged
Merged
Conversation
… the Bypass/Autopilot zero-consent bypass (#4260) Co-Authored-By: ggcode <noreply@ggcode.dev>
Owner
Author
|
终复走读 GO(ggcxf_reviewer,奇数域,escalates 面首轮主审):53 行单点修——switchModeEscalates 对 a.Mode 补 strings.ToLower(TrimSpace) 归一,封 #4260 大小写绕过({mode:Bypass} 曾跳升权 Ask 仍切进 bypass)。与 switch_mode.go 解析侧语义对齐(我首轮验过的双路收敛点,此为 Check 前原始 JSON 路径漏网补丁)。伴测 12 变体双向(7 升权大小写全 Ask/5 非升权保持 Allow)。CI 9/9。即并。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
根因(CRITICAL 提权绕过)
switchModeEscalates 只 TrimSpace 不 ToLower:
Bypass/BYPASS/Autopilot等非全小写形态 !=bypass/autopilot→ #1705 case 1 的 Ask 门返回 false → Check 直接 Allow;而工具端 switch_mode 先 ToLower 再 ParsePermissionMode(大小写不敏感)成功切入 bypass——CoerceEnumValues 在权限判定之后,防线缺口确定。supervised 下模型(或被注入诱导)传 {\mode:\Bypass} 即零确认进入几乎全免审批模式。修(一行语义)
switchModeEscalates 补 strings.ToLower——与解析器同归一化。伴测:7 形态 escalate 断言(Bypass/BYPASS/ByPass/Autopilot/AUTOPILOT/autopilot/带空白)+5 形态不 escalate(Supervised/Auto/plan 等)。
验证
permission 全包 ok+定向族绿+build 绿。
Closes #4260