Skip to content

fix(permission): case-insensitive switch_mode escalation gate (#4260) - #4263

Merged
topcheer merged 1 commit into
mainfrom
fix/issue-4260
Oct 16, 2026
Merged

topcheer merged 1 commit into
mainfrom
fix/issue-4260

Conversation

@topcheer

Copy link
Copy Markdown
Owner

根因(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

… the Bypass/Autopilot zero-consent bypass (#4260)

Co-Authored-By: ggcode <noreply@ggcode.dev>
@topcheer

Copy link
Copy Markdown
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。即并。

@ggaidev ggaidev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GO(单点归一修+12 变体双向伴测)。

@topcheer
topcheer merged commit ac9aa87 into main Oct 16, 2026
9 checks 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.

[code-review] switch_mode 提权确认门大小写敏感绕过:"Bypass"/"Autopilot" 零确认切换(critical)

2 participants