cpa漏洞复现小记
- 内容介绍
- 文章标签
- 相关推荐
https://linux.do/t/topic/1892136
https://linux.do/t/topic/1892269
前面冲浪的时候看到了cpa有漏洞,马上复线了一下
漏洞原理
CPA 的 /v1internal:generateContent 和 /v1internal:streamGenerateContent 端点:
不需要 API Key — 路由没有经过 AuthMiddleware
仅靠 RemoteAddr 检查 — strings.HasPrefix(c.Request.RemoteAddr, “127.0.0.1:”)
反向代理绕过 — nginx/cloudflared 转发流量时,TCP 连接来自 127.0.0.1,检查无效
直接使用服务器凭据 — 通过 ExecuteWithAuthManager 使用 CPA 服务端存储的 OAuth 凭据
测试脚本
已删除
docker bridge不受影响原理
Docker 默认使用 bridge 网络(docker0 网桥,网段通常是 172.17.0.0/16)。
https://linux.do/t/topic/1892136
https://linux.do/t/topic/1892269
前面冲浪的时候看到了cpa有漏洞,马上复线了一下
漏洞原理
CPA 的 /v1internal:generateContent 和 /v1internal:streamGenerateContent 端点:
不需要 API Key — 路由没有经过 AuthMiddleware
仅靠 RemoteAddr 检查 — strings.HasPrefix(c.Request.RemoteAddr, “127.0.0.1:”)
反向代理绕过 — nginx/cloudflared 转发流量时,TCP 连接来自 127.0.0.1,检查无效
直接使用服务器凭据 — 通过 ExecuteWithAuthManager 使用 CPA 服务端存储的 OAuth 凭据
测试脚本
已删除
docker bridge不受影响原理
Docker 默认使用 bridge 网络(docker0 网桥,网段通常是 172.17.0.0/16)。

