All challenges

Tomcat partial PUT deserialization RCE

webhard400pts

Tomcat partial PUT deserialization RCE

CVE-2025-24813 is a path-equivalence bug in Apache Tomcat: with a writable DefaultServlet, partial PUT enabled, file-based session persistence, and a gadget library on the classpath, an attacker can write a serialized session file with a partial PUT and then have Tomcat deserialize it by naming it in a JSESSIONID cookie. Four preconditions, one gadget chain, code execution as the Tomcat process; CVSS 9.8 and CISA KEV listed.

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, readable by the Tomcat process. The server listens on port 8080; the partial PUT endpoint 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: tomcat-partial-put
      FLAG_PATH: /flag/flag.txt
    volumes:
      - flag:/flag
  challenge:
    image: matejbasic/cve-2025-24813: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 tomcat-partial-put

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