Skip to content
XSS Write-up Intermediate

[CVE-2020-11110] What really happened in Grafana code?

A stored cross-site scripting flaw existed in Grafana's snapshot feature, where the originalUrl parameter was saved and later rendered without sanitisation. An attacker could submit a crafted snapshot and have the payload execute when a victim opened the resulting snapshot link.

Mohamed Sayed Follow

Published on flex0geek.blogspot.com

on July 08, 2021

Mohamed Sayed (Flex), on flex0geek.blogspot.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 snapshot controller accepted the originalUrl value from the request body and the snapshot view rendered it without sanitisation.

Impact

An attacker could run script in the browser of anyone who opened the crafted snapshot link, though the text does not describe what actions that script could take.

What the attacker needed

Ability to create a snapshot; victim opens the snapshot link

How it was found

  1. Send a POST request with a crafted originalUrl to the snapshot API endpoint.
  2. Receive a snapshot key in the response.
  3. Open the snapshot link, which requests the dashboard snapshot endpoint with that key.
  4. The snapshot template renders the stored originalUrl and the script executes.

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 lets users save a dashboard as a 'snapshot' and share a link to it. The snapshot stored a URL supplied by the user and later showed it back on the page without cleaning it, so a malicious URL could run script in the viewer's browser. This is called stored cross-site scripting because the harmful content is saved on the server first.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by Mohamed Sayed

View all

9 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.