Skip to content
SSRF Write-up Advanced

CVE-2020-13379

Grafana's avatar endpoint URL-decoded the hash parameter and concatenated it into a request to Gravatar, allowing parameter injection. By chaining open redirects, an attacker could make the server fetch arbitrary URLs, achieving unauthenticated full-read SSRF.

Justin Gardner Follow

Published on rhynorater.github.io

While doing some security research on Grafana for bug bounty, I discovered that by chaining together some redirects and a URL Parameter Injection bug, it is possible to achieve a full-read, unauthenticated, SSRF on any Grafana instance ranging from version 3.0.1 - 7.0.1. The Grafana advisory for this bug can be found…

Justin Gardner, on rhynorater.github.io

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

The avatar route URL-decoded the user-supplied hash and concatenated it directly into an outbound request URL, enabling parameter injection and redirect chaining.

Impact

An unauthenticated attacker could perform a full-read SSRF, potentially accessing cloud metadata credentials and internal services, though the response is returned as image/jpeg.

What the attacker needed

Grafana version 3.0.1 to 7.0.1; No authentication required; Network access to the Grafana instance

The fix

The vulnerability was fixed in Grafana 6.7.4 and 7.0.2.

How it was found

  1. Send a request to the Grafana avatar endpoint with a crafted hash containing encoded parameters.
  2. The hash is URL-decoded and appended to the Gravatar request, injecting a `d` parameter.
  3. Gravatar's `d` parameter redirects to `i0.wp.com`.
  4. A weak regex on `i0.wp.com` allows an open redirect to an arbitrary host.
  5. Grafana follows the redirects and returns the response with `Content-Type: image/jpeg`.

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 dashboard tool. Its avatar feature took a piece of the URL, decoded it, and stuck it onto a request to an external image service without checking it. An attacker could sneak extra instructions into that piece, so the Grafana server would fetch any address the attacker chose, including internal cloud metadata.

What is SSRF?

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.

Similar reports

View all

Same bug class and techniques, clearest first.

Server-side request forgery (SSRF)

The lesson behind this report.

The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.