CVE-2023-3128

9.4 CRITICAL

📋 TL;DR

This vulnerability allows attackers to bypass authentication and take over Grafana accounts when Azure AD OAuth is configured with multi-tenant applications. Attackers can modify email claims in Azure AD profiles to impersonate legitimate users. Organizations using Grafana with Azure AD OAuth multi-tenant configurations are affected.

💻 Affected Systems

Products:
  • Grafana
Versions: All versions before 9.4.13, 9.5.4, 10.0.0
Operating Systems: All
Default Config Vulnerable: ✅ No
Notes: Only affects Grafana instances configured with Azure AD OAuth using multi-tenant applications. Single-tenant configurations are not vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete Grafana account takeover leading to unauthorized access to all dashboards, data sources, and administrative functions, potentially enabling data exfiltration or system compromise.

🟠

Likely Case

Unauthorized access to Grafana dashboards and data sources, potentially exposing sensitive monitoring data and metrics.

🟢

If Mitigated

Limited impact with proper authentication controls, monitoring, and network segmentation in place.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires Azure AD account access to modify email claims, but the attack chain is straightforward once initial access is obtained.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 9.4.13, 9.5.4, 10.0.0

Vendor Advisory: https://grafana.com/security/security-advisories/cve-2023-3128/

Restart Required: Yes

Instructions:

1. Upgrade Grafana to version 9.4.13, 9.5.4, or 10.0.0. 2. Restart Grafana service. 3. Verify the fix by checking the version and testing authentication.

🔧 Temporary Workarounds

Switch to Single-Tenant Azure AD App

all

Configure Azure AD OAuth to use single-tenant applications instead of multi-tenant applications.

Disable Azure AD OAuth

all

Temporarily disable Azure AD OAuth authentication until patching can be completed.

🧯 If You Can't Patch

  • Implement network segmentation to isolate Grafana instances from untrusted networks
  • Enable enhanced logging and monitoring for authentication events and account changes

🔍 How to Verify

Check if Vulnerable:

Check Grafana version and verify Azure AD OAuth configuration uses multi-tenant applications.

Check Version:

grafana-server -v

Verify Fix Applied:

Verify Grafana version is 9.4.13, 9.5.4, or 10.0.0 or later, and test authentication with modified email claims.

📡 Detection & Monitoring

Log Indicators:

  • Unusual authentication patterns
  • Multiple failed login attempts followed by successful login from different email domains
  • Account creation/modification events from unexpected sources

Network Indicators:

  • Authentication requests from unexpected IP ranges
  • Unusual OAuth token exchange patterns

SIEM Query:

source="grafana" AND (event="login" OR event="auth") AND email CONTAINS "@" AND email NOT IN allowed_domains

🔗 References

📤 Share & Export