Skip to content

bug(browser): Windows WFP 受限浏览器生产探针尚未通过验收 #1

Closed

Description

@Qiyuanqiii

问题概述 / Summary

Windows 生产级浏览器网络隔离探针尚未完成实机验收。该探针用于证明受限浏览器的 Edge 进程被精确绑定到动态 WFP 规则,并拒绝未授权端口、错误回环地址、非回环地址和 IPv6 目标。

The Windows production browser-network containment probe has not yet passed its final on-host acceptance run. It is the safety gate for the restricted browser mode, not a prerequisite for the rest of Prayu.

影响 / Impact

  • “受限浏览器(WFP 保护)”不得在缺少有效证据时宣称可用。
  • 普通 Code、CLI、模型调用和不依赖该安全承诺的功能不受影响。
  • 完整 CDP 调试模式应保持独立、显式高风险确认,不能伪装成受限模式。

已观察到的失败链 / Observed failure chain

管理员 PowerShell 中运行:

go run .\cmd\cyberagent doctor browser-network-probe `
  --product edge `
  --collector local-operator `
  --confirm RUN-LOCAL-WFP-BROWSER-PROBE `
  --json

诊断曾依次暴露以下独立阶段:

  1. 已有 Edge 进程阻止无歧义探针启动。
  2. baseline canary 未完成或 Edge 提前退出。
  3. UAC linked token 只有 Identification impersonation level,无法转换为可启动进程的 Primary Token。
  4. 改用严格校验的交互式 explorer.exe Primary Token 后,最后一次修复前生产证据停在:
baseline_process_create_with_token_invalid_parameter

注意:该最后证据产生于 20865b5 之前;20865b5 之后尚未进行新的管理员生产验收,因此当前状态既不能标记为通过,也不能断言仍以同一码失败。

已落地修复 / Implemented fixes

  • e5c7f1f: 从当前交互会话的可信 explorer.exe 获取 Primary Token,并校验同 SID、同 Session、非提权、中完整性、Primary 类型和系统路径。
  • 20865b5: 每次 Win32 进程创建使用独立可写命令行缓冲区;CreateProcessWithTokenW 备用路径创建挂起进程,先绑定 Job、验证子进程身份,再恢复主线程。
  • 失败码按 authority_acquire、process_create、process_create_with_token、job_bind_after_token 等阶段细分。

当前验证 / Current verification

以下本机非生产回归已通过:

  • installed Edge baseline smoke
  • interactive shell Primary Token smoke
  • go test ./internal/browserruntime -count=1
  • go vet ./internal/browserruntime

这些结果不等价于管理员 WFP 生产验收通过。

验收条件 / Acceptance criteria

一次管理员生产探针必须同时满足:

  • dynamic_session_observed: true
  • atomic_install_observed: true
  • exact_target_observed: true
  • wrong_port_denied: true
  • wrong_loopback_address_denied: true
  • non_loopback_address_denied: true
  • ipv6_denied: true
  • rule_cleanup_observed: true
  • synthetic: false
  • production: true
  • passed: true

并确认:

  • Edge 子进程为同用户、同会话、非提权、中完整性 Primary Token。
  • 子进程在恢复执行前已经绑定到受限 Job。
  • 探针结束后无遗留 WFP 规则、浏览器进程或临时 Profile。
  • 任一验证缺失时继续 fail closed,并给出可定位的阶段码。

临时策略 / Interim policy

  • WFP 受限浏览器入口保持未验收状态。
  • 不阻塞项目其他主线功能。
  • 完整 CDP 仅能作为独立的“高度敏感权限”调试模式,由用户显式开启和审计。
  • 后续诊断集中在本 Issue,避免在功能开发对话中反复消耗人工试跑。

Metadata

Metadata

Assignees

Labels

blockedBlocked by external evidence or dependencybrowserBrowser runtime and CDP capabilitiesbugSomething isn't workingsecuritySecurity boundary or high-risk capability高难度

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions