CVE-2026-21726: Github.com/grafana/loki/v3 Path Traversal Vulnerability

MODERATE
Advisory Identifier: GHSA-497x-rrr9-68jp
CVSS 5.3
CWE-601 CWE-22
Published
Advisory Summary

CVE-2026-21726 is a MODERATE (CVSS 5.3) path traversal vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Github.com/grafana/loki/v3 libraries in the Go ecosystem. The issue involves grafana loki path traversal - cve-2021-36156 bypass. Remediation is available by upgrading affected packages to version 3.6.4.

CVE-2026-21726 at a Glance

CVE Identifier CVE-2026-21726
GHSA Identifier GHSA-497x-rrr9-68jp
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product Github.com/grafana/loki/v3
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-21726

To remediate this vulnerability, upgrade all affected Github.com/grafana/loki/v3 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/grafana/loki/v3 fixed: 3.6.4
Upgrade github.com/grafana/loki/v3 to 3.6.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/grafana/loki/v3

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-21726, inspect your project dependencies for Github.com/grafana/loki/v3:

inspect dependencies for github.com/grafana/loki/v3

Analyze the terminal output to locate any version of Github.com/grafana/loki/v3 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.6.4), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In Github.com/grafana/loki/v3, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2026-21726 Affected Github.com/grafana/loki/v3 Versions

1 component(s)
Fixed Versions:
3.6.4
Product / Package Ecosystem Affected Versions Fixed Version
github.com/grafana/loki/v3
Go
< 3.6.4
3.6.4

References

Frequently Asked Questions

What is CVE-2026-21726?
CVE-2026-21726 is a security vulnerability in Github.com/grafana/loki/v3 involving Grafana Loki Path Traversal - CVE-2021-36156 Bypass under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which Github.com/grafana/loki/v3 versions are affected?
Affected versions include releases prior to 3.6.4 across affected packages: github.com/grafana/loki/v3.
What version fixes CVE-2026-21726?
Upgrading to 3.6.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/grafana/loki/v3 affected?
Yes, github.com/grafana/loki/v3 is affected in releases prior to 3.6.4. Upgrade your dependency to 3.6.4 or later.
What is the CVSS score of CVE-2026-21726?
CVE-2026-21726 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2026-21726?
CVE-2026-21726 is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check Go dependencies for CVE-2026-21726?
Run the dependency tree command: 'inspect dependencies for github.com/grafana/loki/v3'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-497x-rrr9-68jp",
  "modified" : "2026-04-16T21:42:00Z",
  "published" : "2026-04-15T21:30:18Z",
  "aliases" : [ "CVE-2026-21726" ],
  "summary" : "Grafana Loki Path Traversal - CVE-2021-36156 Bypass",
  "details" : "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}\n\nThanks to Prasanth Sundararajan for reporting this vulnerability.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/grafana/loki/v3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.6.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-21726"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/grafana/loki"
  }, {
    "type" : "WEB",
    "url" : "https://grafana.com/security/security-advisories/cve-2026-21726"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-601" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-16T21:42:00Z",
    "nvd_published_at" : "2026-04-15T20:16:34Z"
  }
}