Skip to content
Path traversal Write-up Intermediate

CVE-2025–4123 Grafana Open Redirect & SSRF — Full PoC — CVS

A client-side path traversal flaw in Grafana's /public/ static file handler allows an attacker to craft a URL that escapes the intended directory, leading to open redirect, SSRF, or stored XSS. An attacker could redirect victims to malicious sites, access internal services, or execute JavaScript in a victim's browser.

Dharanis Follow

Published on medium.com

CVE-2025–4123 is a high-severity vulnerability affecting Grafana — the industry-standard open-source observability platform deployed across millions of engineering stacks worldwide. Discovered by security researcher Alvaro Balada via Grafana’s bug bounty program on April 26, 2025, it was publicly disclosed on May 21…

Dharanis, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the static file handler did not properly normalise or validate URL-encoded path traversal sequences (such as ..%2F and %5c) before issuing a redirect, allowing escape from the /public/ directory.

Impact

An attacker could redirect users to phishing sites, access internal cloud metadata and APIs if the Image Renderer plugin is installed, or execute JavaScript in a victim's browser if anonymous access is enabled; the open redirect works regardless of authentication settings.

What the attacker needed

Grafana version < 12.0.0-security-01; No authentication required for open redirect; Image Renderer plugin for SSRF; Anonymous access enabled for XSS

The fix

Upgrade Grafana to version 12.0.0-security-01 or later, or to the listed backport versions for older tracks; as a temporary measure, block requests containing encoded backslashes or traversal sequences in the /public/ path and disable anonymous access if not needed.

How it was found

  1. Find a Grafana instance using FOFA with the Grafana favicon hash.
  2. Confirm the version via the unauthenticated /api/health endpoint.
  3. Send a crafted GET request to /public/ with encoded traversal sequences to trigger a 302 redirect.
  4. Observe the Location header pointing to an external domain, confirming open redirect.
  5. For SSRF, ensure the Image Renderer plugin is installed and target internal metadata services.
  6. For XSS, enable anonymous access and craft a URL that executes JavaScript in the victim's browser.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Grafana is a tool for monitoring systems. A part of its web server that serves static files could be tricked into treating a specially crafted web address as pointing outside its intended folder. This let an attacker send users to a fake login page, or make the server fetch internal resources, or run malicious code in a victim's browser.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

More by Dharanis

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.