All challenges

JWT alg:none authentication bypass

webmedium250pts

JWT alg:none authentication bypass

The login endpoint issues a signed JWT, but the verifier does not enforce the expected algorithm. A token with alg set to none and an empty signature is accepted, so forging one with admin privileges unlocks an admin view that returns the flag.

How to reach it

Run the challenge locally with its docker-compose. The flagger sidecar writes your per-run flag to /flag/flag.txt, which the admin view reads. The service speaks HTTP on port 8080; the login and admin endpoints are the entry points.

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: jwt-alg-none
      FLAG_PATH: /flag/flag.txt
    volumes:
      - flag:/flag
  challenge:
    image: matejbasic/jwt-alg-none: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 jwt-alg-none

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