# CVE-2026-21726: Loki Path Traversal - CVE-2021-36156 Bypass

> Attackers can bypass path traversal protections in Grafana Loki to read arbitrary files via the Ruler API endpoint.

- **Severity:** Medium 5.3 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 15 Apr 2026
- **Updated:** 27 Aug 2026
- **Also known as:** CLEANSTART-2026-JO14647, CLEANSTART-2026-WN62977, CLEANSTART-2026-YM30518, CLEANSTART-2026-ZS27491, ECHO-d86c-cc77-aee6, GHSA-497x-rrr9-68jp, GO-2026-5115, MINI-2hgx-gh8q-r66m, MINI-3376-m49q-82jj, MINI-3wgj-6m78-mpf8, MINI-43q4-qxwp-6qpj, MINI-5hwp-xm7h-33rf, MINI-5p5x-gmq6-49x6, MINI-8gv7-pqm7-mx42, MINI-9cjh-8h5h-6r8p, MINI-9v53-pwqr-pj2w, MINI-9xj5-w7rv-r3qg, MINI-cc95-64vw-32m8, MINI-ccpr-458h-wh3j, MINI-cqcr-qgp9-5wpc, MINI-ff7w-qg8c-jc9x, MINI-g29c-7xwp-5hhw, MINI-gxrj-9mrw-r8cm, MINI-h8xp-3pvj-q6mf, MINI-m2cj-h79x-rhgc, MINI-qffh-4xvv-h66q, MINI-qfm4-fp5v-2m77, MINI-qpcp-5x47-qh4g, MINI-v89m-7wq7-f559, MINI-vf2w-f8gp-2xw9, MINI-w66g-855v-4f99, MINI-wfgh-wchv-f2fg, MINI-x268-59h8-8693, MINI-x63h-rc69-r3hq

## What is CVE-2026-21726?

CVE-2026-21726 is a medium-severity path traversal vulnerability in Grafana Loki, published on 15 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The CVE-2021-36156 fix validates the namespace parameter for path traversal sequences after a single URL decode, by double encoding, an attacker can read files at the Ruler API endpoint /loki/api/v1/rules/{namespace}

Thanks to Prasanth Sundararajan for reporting this vulnerability.

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

## Which versions are affected by CVE-2026-21726?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/grafana/loki/v3` | Go | All versions | 3.6.4 |
| `github.com/grafana/loki/v3` | Go | All versions | 3.6.4 |
| `github.com/grafana/loki/v3` | Go | All versions | 3.6.4 |
| `github.com/grafana/loki` | Go | All versions | None |

Products: Grafana Loki.

## How do I fix CVE-2026-21726?

Upgrade github.com/grafana/loki/v3 to 3.6.4 or later.

## Is CVE-2026-21726 being exploited?

There is no known exploitation of CVE-2026-21726 in the wild and no public exploit code.

## Other vulnerabilities in Grafana Loki

- [CVE-2021-36156](https://insights.sbomify.com/CVE-2021-36156/): Path traversal in Grafana Loki (medium 5.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-21726 and fix it if it is affected.

What it is: CVE-2026-21726 is a medium-severity path traversal vulnerability in Grafana Loki, published on 15 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-21726 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/grafana/loki/v3 (Go): affected all versions; fixed in 3.6.4
- github.com/grafana/loki/v3 (Go): affected all versions; fixed in 3.6.4
- github.com/grafana/loki/v3 (Go): affected all versions; fixed in 3.6.4
- github.com/grafana/loki (Go): affected all versions; no fix listed

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-2026-21726/ (Markdown: https://insights.sbomify.com/CVE-2026-21726/index.md)
```

## Sources

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

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