Skip to content
Path traversal Write-up Advanced

“How CVE-2025–4123 Turned Grafana Into a Hacker’s Playgroun

Grafana's static file handler failed to sanitise user-supplied paths, allowing path traversal that could be chained with an open redirect, XSS, and SSRF. An attacker could execute JavaScript in a victim's browser, steal sessions, change emails, and access cloud metadata.

Aman Sharma Follow

Published on infosecwriteups.com

free link | friend link

Aman Sharma, on infosecwriteups.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 sanitise user-supplied paths, and redirect logic appended a slash without validation.

Impact

Attackers could hijack sessions, change user emails, delete admin accounts, and pivot to internal systems; the text notes that anonymous access must be enabled for the XSS to work without authentication, and SSRF requires the Image Renderer plugin.

What the attacker needed

Grafana instance vulnerable to CVE-2025-4123; Anonymous access enabled for XSS without auth; Image Renderer plugin installed for SSRF

The fix

Upgrade to a patched Grafana version, enable a strict Content Security Policy, and disable unused plugins such as the Image Renderer.

How it was found

  1. Send a crafted URL with directory traversal sequences to the Grafana server.
  2. Use a path that resolves to a directory to trigger an open redirect to an external domain.
  3. Host malicious frontend plugins on the attacker's domain and have Grafana load them via the redirect.
  4. If the Image Renderer plugin is installed, abuse the /render endpoint to fetch internal resources such as cloud metadata.
  5. Combine XSS and SSRF to hijack sessions, change emails, delete admin accounts, and pivot to internal systems.

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.

A path traversal bug lets someone trick a web server into reading files or folders outside the area it should serve, by using '..' in a URL. Here, that flaw was combined with other weaknesses so an attacker could run their own code in a victim's browser and reach internal cloud services.

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 Aman Sharma

View all

34 more disclosed reports, 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.