CVE-2026-21726

Loki Path Traversal - CVE-2021-36156 Bypass

Published Apr 15, 2026 CVSS 3.1 · 5.3 Medium EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

A double URL‑encoding bypass allows an attacker to trick the Loki namespace validator into performing a single decode that still contains a path traversal sequence. The attacker can then read files through the /loki/api/v1/rules/{namespace} endpoint. The impact is that sensitive files on the host can be exfiltrated, potentially exposing configuration or credential data. The weakness corresponds to improper path traversal handling (CWE-22, CWE-76).

Affected Systems

Grafana Loki deployments that have not yet applied the fix for CVE-2021-36156. The vulnerability is specifically tied to the Ruler API endpoint and applies to any version of Loki before the patched release; no exact version range was supplied in the advisory.

Risk and Exploitability

The CVSS score of 5.3 indicates medium severity, and the EPSS score of < 1% indicates an extremely low exploitation probability. The vulnerability is not currently in the CISA KEV catalog. Attack vectors are inferred to be network‑based; an entity with network access to the Ruler API could craft the payload. Exploitation requires only that the attacker can supply a crafted namespace parameter via an HTTP request to the Loki instance.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Grafana Loki to a version that includes the CVE‑2021‑36156 patch
  • If immediate upgrade is not possible, isolate the Loki instance from external networks to limit remote access to the Ruler API
  • Configure access controls to restrict who can query the /loki/api/v1/rules/{namespace} endpoint, ensuring only authenticated and authorized users can provide namespace parameters

Generated by OpenCVE AI on April 21, 2026 at 00:06 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-497x-rrr9-68jp Grafana Loki Path Traversal - CVE-2021-36156 Bypass
History
Type Values Removed Values Added
CPEs cpe:2.3:a:grafana:loki:*:*:*:*:*:*:*:*
Type Values Removed Values Added
Weaknesses CWE-22
Type Values Removed Values Added
Weaknesses CWE-22
Type Values Removed Values Added
Weaknesses CWE-22
Type Values Removed Values Added
First Time appeared Grafana
Grafana loki
Vendors & Products Grafana
Grafana loki
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
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.
Title Loki Path Traversal - CVE-2021-36156 Bypass
References
Metrics cvssV3_1

{'score': 5.3, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N'}

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

  • CWE-76

    Improper Neutralization of Equivalent Special Elements

Sources

Status
PUBLISHED
Assigner
GRAFANA
Published
Updated
Aug 27, 2026, 5:22 PM
Reserved
Jan 5, 2026, 9:26 AM
Status
Analyzed
Published
Apr 15, 2026, 8:16 PM
Modified
Oct 26, 2026, 9:10 PM
Severity
Moderate
Public date
Apr 15, 2026, 7:24 PM