All challenges

Prototype pollution privilege escalation

webhard300pts

Prototype pollution privilege escalation

A settings endpoint deep-merges user JSON into a config object with a recursive merge that walks proto keys. A request that sets a property on Object.prototype makes a later freshly created object inherit it, so an admin check that reads that property passes and the admin route 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 route reads. The service speaks HTTP on port 8080; the settings 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: config-merge-proto
      FLAG_PATH: /flag/flag.txt
    volumes:
      - flag:/flag
  challenge:
    image: matejbasic/config-merge-proto: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 config-merge-proto

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