# CVE-2021-43798: Grafana Path Traversal

> Attackers can read local files via directory traversal in Grafana plugin URLs, exposing sensitive system data.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Yes, since 9 Oct 2025 (CISA KEV)
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 7 Dec 2021
- **Updated:** 21 Oct 2025
- **Also known as:** BIT-grafana-2021-43798, GHSA-8pjx-jj86-j47p

## What is CVE-2021-43798?

CVE-2021-43798 is a high-severity path traversal vulnerability in Grafana Grafana, published on 7 Dec 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Grafana is an open-source platform for monitoring and observability. Grafana versions 8.0.0-beta1 through 8.3.0 (except for patched versions) iss vulnerable to directory traversal, allowing access to local files. The vulnerable URL path is: `<grafana_host_url>/public/plugins//`, where is the plugin ID for any installed plugin. At no time has Grafana Cloud been vulnerable. Users are advised to upgrade to patched versions 8.0.7, 8.1.8, 8.2.7, or 8.3.1. The GitHub Security Advisory contains more information about vulnerable URL paths, mitigation, and the disclosure timeline.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2021-43798?

9 open source packages ship an affected version, including github.com/grafana/grafana and grafana. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/grafana/grafana` | Go | From 8.0.0-beta1 | 8.0.7 |
| `github.com/grafana/grafana` | Go | From 8.0.0-beta1 | 8.0.7 |
| `github.com/grafana/grafana` | Go | From 8.1.0 | 8.1.8 |
| `github.com/grafana/grafana` | Go | From 8.1.0 | 8.1.8 |
| `github.com/grafana/grafana` | Go | From 8.2.0 | 8.2.7 |
| `github.com/grafana/grafana` | Go | From 8.2.0 | 8.2.7 |
| `github.com/grafana/grafana` | Go | From 8.3.0 | 8.3.1 |
| `github.com/grafana/grafana` | Go | From 8.3.0 | 8.3.1 |
| `grafana` | Bitnami | From 8.0.1 | 8.0.7, 8.1.8, 8.2.7, 8.3.1 |

Products: Grafana Grafana.

## How do I fix CVE-2021-43798?

Upgrade github.com/grafana/grafana to a fixed version for your release line: 8.0.7, 8.1.8, 8.2.7 or 8.3.1. US federal agencies must fix it by 30 Oct 2025.

## Is CVE-2021-43798 being exploited?

Yes. Attackers have exploited CVE-2021-43798 in the wild since at least 9 Oct 2025.

Public exploit code:

- Grafana Unauthorized arbitrary file reading vulnerability (github_poc): https://github.com/jas502n/Grafana-CVE-2021-43798
- A exploit tool for Grafana Unauthorized arbitrary file reading vulnerability (CVE-2021-43798), it can burst plugins / extract secret_key / decrypt data_source info automatic. (github_poc): https://github.com/A-D-Team/grafanaExp
- This is a proof-of-concept exploit for Grafana's Unauthorized Arbitrary File Read Vulnerability (CVE-2021-43798). (github_poc): https://github.com/pedrohavay/exploit-grafana-CVE-2021-43798
- CVE-2021-43798 - Grafana 8.x Path Traversal (Pre-Auth) (github_poc): https://github.com/taythebot/CVE-2021-43798
- Grafana Arbitrary File Reading Vulnerability (github_poc): https://github.com/zer0yu/CVE-2021-43798
- CVE-2021-43798:Grafana 任意文件读取漏洞 (github_poc): https://github.com/Mr-xn/CVE-2021-43798

## Other vulnerabilities in Grafana Grafana

- [CVE-2025-41115](https://insights.sbomify.com/CVE-2025-41115/): Incorrect privilege assignment (critical 10.0)
- [CVE-2022-39328](https://insights.sbomify.com/CVE-2022-39328/): Grafana vulnerable to race condition allowing privilege escalation (critical 9.8)
- [CVE-2022-28660](https://insights.sbomify.com/CVE-2022-28660/): Auth bypass in n/a (critical 9.8)
- [CVE-2022-26148](https://insights.sbomify.com/CVE-2022-26148/): Information disclosure in n/a (critical 9.8)
- [CVE-2018-15727](https://insights.sbomify.com/CVE-2018-15727/): Grafana Authentication Bypass (critical 9.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-43798 and fix it if it is affected.

What it is: CVE-2021-43798 is a high-severity path traversal vulnerability in Grafana Grafana, published on 7 Dec 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: Yes. Attackers have exploited CVE-2021-43798 in the wild since at least 9 Oct 2025.

Affected packages and fixed versions:
- github.com/grafana/grafana (Go): affected from 8.0.0-beta1; fixed in 8.0.7
- github.com/grafana/grafana (Go): affected from 8.0.0-beta1; fixed in 8.0.7
- github.com/grafana/grafana (Go): affected from 8.1.0; fixed in 8.1.8
- github.com/grafana/grafana (Go): affected from 8.1.0; fixed in 8.1.8
- github.com/grafana/grafana (Go): affected from 8.2.0; fixed in 8.2.7
- github.com/grafana/grafana (Go): affected from 8.2.0; fixed in 8.2.7
- github.com/grafana/grafana (Go): affected from 8.3.0; fixed in 8.3.1
- github.com/grafana/grafana (Go): affected from 8.3.0; fixed in 8.3.1
- grafana (Bitnami): affected from 8.0.1; fixed in 8.0.7, 8.1.8, 8.2.7, 8.3.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2021-43798/ (Markdown: https://insights.sbomify.com/CVE-2021-43798/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2021-43798
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2021-43798
- OSV: https://osv.dev/vulnerability/CVE-2021-43798

---
From sbomify Insights: https://insights.sbomify.com/CVE-2021-43798/
Summaries are generated and may contain mistakes; the official description above is the record.
