All challenges

Grafana SQL Expressions file read

webeasy200pts

Grafana SQL Expressions file read

CVE-2024-9264 is an injection in the experimental SQL Expressions feature of Grafana 11.0.x: user input is piped to the duckdb binary, which exposes functions like read_blob(). With anonymous access enabled as Viewer, an unauthenticated request can read any file the Grafana process can reach.

How to reach it

Run the challenge locally with its docker-compose. The flagger sidecar writes your per-run flag to /flag/flag.txt inside the container. Grafana listens on port 8080 with anonymous Viewer access; the expressions API is the entry point.

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-duckdb-lfi
      FLAG_PATH: /flag/flag.txt
    volumes:
      - flag:/flag
  challenge:
    image: matejbasic/cve-2024-9264: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-duckdb-lfi

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