CVE-2021-43798

7.5 HIGH

📋 TL;DR

CVE-2021-43798 is a directory traversal vulnerability in Grafana that allows attackers to read arbitrary files on the server by exploiting a flaw in the plugin URL handling. This affects self-hosted Grafana installations running vulnerable versions, potentially exposing sensitive configuration files, credentials, or other local data. Grafana Cloud instances are not affected.

💻 Affected Systems

Products:
  • Grafana
Versions: 8.0.0-beta1 through 8.3.0 (excluding patched versions)
Operating Systems: All operating systems running Grafana
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects self-hosted Grafana instances. Grafana Cloud is not vulnerable. The vulnerability exists in the public/plugins/ endpoint handling.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete server compromise through reading sensitive files like /etc/passwd, Grafana configuration files containing database credentials, or SSH keys, leading to lateral movement and data exfiltration.

🟠

Likely Case

Unauthorized access to sensitive configuration files, potentially exposing database credentials, API keys, or other secrets stored in readable files on the Grafana server.

🟢

If Mitigated

Limited impact with proper network segmentation, file system permissions restricting Grafana's access, and monitoring for suspicious file access patterns.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: CONFIRMED
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Multiple public exploit scripts and detailed technical analysis available. Exploitation requires no authentication and uses simple HTTP requests.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 8.0.7, 8.1.8, 8.2.7, or 8.3.1

Vendor Advisory: https://grafana.com/blog/2021/12/10/grafana-8.3.1-released-with-high-severity-security-fix/

Restart Required: Yes

Instructions:

1. Identify current Grafana version. 2. Backup configuration and data. 3. Upgrade to patched version using package manager (apt/yum) or download from Grafana website. 4. Restart Grafana service. 5. Verify upgrade completed successfully.

🔧 Temporary Workarounds

Web Application Firewall Rule

all

Block malicious requests to the vulnerable endpoint using regex patterns

WAF specific - configure rule to block requests matching pattern: ^/public/plugins/[^/]+/.*\.\./

Reverse Proxy Blocking

linux

Configure nginx or Apache to block traversal attempts

location ~ ^/public/plugins/[^/]+/(.*\.\./) { return 403; }

🧯 If You Can't Patch

  • Implement network segmentation to restrict Grafana server access to trusted networks only
  • Apply strict file system permissions to limit Grafana process access to sensitive files

🔍 How to Verify

Check if Vulnerable:

Check Grafana version: if between 8.0.0-beta1 and 8.3.0 (excluding 8.0.7, 8.1.8, 8.2.7, 8.3.1), you are vulnerable. Test with curl: curl -v 'http://grafana-host/public/plugins/alertlist/../../../../../../../../etc/passwd'

Check Version:

grafana-server -v or check /usr/share/grafana/VERSION file

Verify Fix Applied:

After patching, the same curl command should return 404 or proper error instead of file contents. Verify version shows patched release.

📡 Detection & Monitoring

Log Indicators:

  • HTTP 200 responses to /public/plugins/ with ../ sequences in URL
  • Unusual file access patterns from Grafana process

Network Indicators:

  • HTTP requests containing /public/plugins/ followed by directory traversal sequences (../)

SIEM Query:

source="grafana" AND url="/public/plugins/*" AND (url="*../*" OR status=200 AND bytes>1000)

🔗 References

📤 Share & Export