CVE-2026-21726: Grafana Loki Path Traversal Vulnerability Bypass

github.com/grafana/loki/v3 Updated 17 Apr 2026

Summary

15/04/2026
Yes i
Moderate
5.3

CVE-2026-21726: Grafana Loki Path Traversal - CVE-2021-36156 Bypass. Affects github.com/grafana/loki/v3 versions < 3.6.4. Fixed in 3.6.4. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Grafana Loki is an open-source log aggregation system designed for efficiency and scalability. It allows users to collect, store, and query logs from various sources, making it a vital tool for monitoring and troubleshooting applications. The system is built on a microservices architecture and is often used in conjunction with Grafana for visualization. However, a recent vulnerability has been identified that could allow unauthorized access to sensitive files through a path traversal attack.

Vulnerability Detail

The vulnerability arises from an improper validation of the namespace parameter in the Ruler API endpoint (/loki/api/v1/rules/{namespace}). The fix for CVE-2021-36156 only validates the parameter after a single URL decode. By exploiting this flaw through double encoding, an attacker can bypass the validation and potentially read sensitive files on the server. This could lead to unauthorized access to configuration files or other critical data, posing a significant security risk.

How To Fix

Latest published version: v3.7.9 as of 23 Oct 2026

go get github.com/grafana/loki/v3@v3.7.9

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

3.6.4

This is the first release that contains the fix.

go get github.com/grafana/loki/v3@v3.6.4

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, ensure that your application does not expose the Ruler API endpoint to untrusted users. Implement strict access controls to limit who can interact with this endpoint until the package can be updated.

Conclusion

The CVE-2026-21726 vulnerability in Grafana Loki poses a moderate security risk due to its potential for path traversal attacks. Users are advised to update to version 3.6.4 or later to mitigate this risk. Additionally, implementing access controls can help protect against exploitation until the update is applied.

See every vulnerability recorded for github.com/grafana/loki/v3 →

Share this vulnerability

FAQ

CVE-2026-21726 is a vulnerability in Grafana Loki that allows for path traversal attacks, potentially enabling unauthorized file access.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

If exploited, this vulnerability could allow attackers to access sensitive files on the server, leading to data breaches or unauthorized access to critical information.

Yes, the vulnerability has been patched in version 3.6.4 of Grafana Loki. It is crucial to update to this version or later.

Vulert is a monitoring tool that uses Gopkg.lock to track open-source vulnerabilities in real-time, providing alerts for any issues detected in your software.

How To Fix

Latest published version: v3.7.9 as of 23 Oct 2026

go get github.com/grafana/loki/v3@v3.7.9

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

3.6.4

This is the first release that contains the fix.

go get github.com/grafana/loki/v3@v3.6.4

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback