All challenges

Grafana plugin path traversal

webeasy200pts

Grafana plugin path traversal

CVE-2021-43798 is an unauthenticated directory traversal in Grafana 8.0.0-beta1 through 8.3.0. Grafana serves each plugin's bundled assets under /public/plugins/<pluginId>/, and on the affected versions it joins the request path onto the plugin directory without confirming the result stays inside it. Encoded ../ sequences walk out of the plugin folder and the server returns whatever file they resolve to, with no login required.

How to reach it

Run the challenge locally with its docker-compose. The flagger sidecar writes your per-run flag to /flag/flag.txt on the shared volume before Grafana starts. The service speaks HTTP on port 8080, and the plugin asset route under /public/plugins/ is the entry point. Most HTTP clients collapse ../ before sending, so the traversal has to reach the server encoded.

Run this challenge

Spin it up locally with Docker. The flagger sidecar fetches a per-run flag into a shared volume, then the challenge container boots and reads it.

compose.yml
services:
  flagger:
    image: matejbasic/rootcause-flagger:1.0
    environment:
      ROOTCAUSE_API_URL: https://root-cause-api.matejbasic.com
      ROOTCAUSE_API_KEY: ${ROOTCAUSE_API_KEY}
      ROOTCAUSE_CHALLENGE: grafana-traversal
      FLAG_PATH: /flag/flag.txt
    volumes:
      - flag:/flag
  challenge:
    image: matejbasic/cve-2021-43798:1.0
    depends_on:
      flagger:
        condition: service_completed_successfully
    environment:
      FLAG_PATH: /flag/flag.txt
    volumes:
      - flag:/flag
    ports:
      - "8080:8080"
volumes:
  flag:
one-line CLI
rootcause start grafana-traversal

The rootcause CLI does all of this in one command. Running a challenge needs your API key, which you generate in your profile.