| CVE | CVE-2026-104099 |
| 组件 | fabio — proxy/http_proxy.go::HTTPProxy.ServeHTTP(路由选择 / ACL 门控) |
| 受影响版本 | >= 1.7.0, < 1.7.3(已在 HEAD b841544 确认) |
| 修复版本 | 1.7.3 — 提交 f00ce1a(Merge commit from fork,GHSA-4hrh-34w3-5ww8) |
| CWE | CWE-862(缺少授权)、CWE-22(路径名限制不当) |
| 影响 | 路由选择使用了原始、未规范化的请求路径,而每条路由的 ACL 和 basic-auth 门控都依赖于该选择结果。受保护路径的点段、编码点或双斜杠变体会选择不同的路由,跳过两道门控,并被转发到会规范化并返回受保护资源的后端。无需认证;可完全绕过运维人员配置的访问控制。在 Kubernetes 中,不受信任的镜像或恶意客户端可以访问本应受限的路由 |
| 向量 | 使用未规范化路径的未认证 HTTP 请求(/admin/../admin、/admin/%2e%2e/admin) |
| 触发条件 | 任何可通过 catch-all 路由访问的受保护前缀 → 后端返回受保护资源 |
存在漏洞的处理程序将原始路径转发给 Lookup:
// proxy/http_proxy.go — pre-fix
t := p.Lookup(r) // r.URL.Path is the raw, un-normalized path
if t.AccessDeniedHTTP(r) { ... } // ACL hangs off the SELECTED route
该修复在路由之前进行规范化:
// fixed (commit f00ce1a)
r.URL.Path = normalizePath(r.URL.Path) // url.Parse + path.Clean, trailing slash kept
t := p.Lookup(r)
fabio 按收到的原样从 r.URL.Path 中选择路由,然后应用该路由的 ACL 和 basic-auth 校验。Go 的 HTTP 服务器在将路径传递给自定义处理器之前不会清理路径,而 r.URL.Path 已经过百分号解码,因此 /admin/../admin 和 /admin/%2e%2e/admin 都会带着完整的点段到达 Lookup。两者都不匹配为精确受保护路径 /admin 配置的路由,因此会选中一条不带 ACL 的 catch-all 路由。代理将原始路径转发到上游;后端将其清理为 /admin 并提供受保护资源。修复方案从 url.Parse 加上 path.Clean(保留末尾斜杠)推导出规范化路径,并在 Lookup 之前将其赋值给 r.URL.Path,从而使路由和两道校验看到与后端将要提供的相同路径。
| 服务 | 镜像 | 角色 |
|---|---|---|
fb-vuln | cve-2026-104099:vuln | 真实 fabio @ e23df7bc(修复的父提交),使用 Go 1.26 构建 |
fb-fixed | cve-2026-104099:fixed | 真实 fabio @ f00ce1a(修复,版本 1.7.3) |
poc | cve-2026-104099-poc:local | 仅使用标准库的 Python 驱动程序 |
双方都在各自固定的提交上编译实际的上游 proxy.HTTPProxy。测试框架仅提供的部分是 Lookup 回调——一种运维风格的路由配置:精确的 /admin → route.Target,并带有拒绝所有请求的 ACL,其余所有请求 → 一个无防护的目标——以及一个使用 path.Clean 进行规范化、并为 /admin 提供 PROTECTED-SECRET 的后端。
./run-lab.sh build # builds both sides from pinned upstream commits (Go 1.26)
./run-lab.sh up # cve104099lab network: fb-vuln / fb-fixed
./run-lab.sh sweep
./run-lab.sh down
poc/poc.py(仅使用标准库):
/admin/../admin 返回 200 并带有受保护正文时退出码为 1,当 ACL 返回 403 时退出码为 0;3 表示无 worker,2 表示不可达/无法确定。f00ce1a / 在 Lookup 之前进行规范化。独立的完整攻击链利用程序位于 exploit/exploit.py:
python3 exploit/exploit.py --host=fb-vuln
# exit 1 on confirmed ACL bypass, 0 on a safe target
| 请求 | fb-vuln(e23df7bc) | fb-fixed(f00ce1a,1.7.3) |
|---|---|---|
/admin/../admin | 200 — PROTECTED-SECRET(ACL 绕过) | 403 — access denied |
/admin/%2e%2e/admin | 200 — PROTECTED-SECRET | 403 — access denied |
/admin | 403 — access denied | 403 — access denied |
捕获的运行记录:evidence/check-*-run.txt、evidence/exploit-*-run.txt、
evidence/probe-*-run.txt、evidence/mitigation-*-run.txt、
evidence/exploit-standalone-run.txt、evidence/exploit-standalone-fixed-run.txt、
evidence/versions.txt、evidence/0day-sweep.txt。
cve104099lab
网络上运行有界容器;实验镜像中带有 Go 1.26 工具链;构建时从
固定提交获取上游源码。规范化在路由选择之前应用,因此也在每路由 ACL 和 basic-auth 校验
之前应用。直接路径 /admin 在两个构建上仍被拒绝,
确认受保护路由本身未受影响。在此处测试的向量中——点段、百分号
编码的点段和直接路径——在修复版本上未观察到残留绕过。
README.md this write-up
run-lab.sh environment driver (build / up / sweep / down)
Makefile convenience targets
poc/poc.py the PoC (check / exploit / probe / mitigation)
exploit/exploit.py standalone full-chain exploit
lab/harness.go operator-style Lookup + normalizing backend
lab/lab.Dockerfile builds the real fabio proxy at each pinned commit
lab/service.py HTTP wrapper (POST /request), child-process isolation
evidence/ captured runs of every mode on both sides
TRACKING.md excluded (working record)
proxy/http_integration_test.go::TestProxyPathNormalization