Skip to content
Adam Omar Saleh

Chronos Security logo, as used by CSCTF 2026CSCTF 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
Chronos Security logo, as used by CSCTF 2026CSCTF 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:

  1. PIN bypass — POST /api/station/pin-check returns a usable attempt token even when the PIN is wrong, and POST /api/station/activate accepts that token without re-checking that the PIN actually matched. Activation hands us the WebSocket capability, the cordon centre and the room name.

  2. Location spoofing — eligibility for the protected room is decided purely from the latitude/longitude a 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 the clearance_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:

JavaScript
// 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

  1. GET / to obtain a station session cookie.

  2. POST /api/station/pin-check with any syntactically valid PIN (e.g. 123456). Response: PIN_MISMATCH plus "attempt": "<token>", valid 60 s (endpoint is rate-limited to 5 / 600 s).

  3. POST /api/station/activate with {"attempt": "<token>"}. Despite the wrong PIN it returns STATION_ACTIVE with:

    • cap — WebSocket capability

    • lat_e6 = -47203945, lon_e6 = -126300000 → centre -47.203945, -126.300000

    • radius_m = 75, room = "cordon-seven"

  4. Open ws://<host>/ws (sending the station cookie) and send station.authenticate with the cap → station.accepted. The protocol uses a running sequence, echoed back as next_sequence.

  5. Send position.update with the cordon centre coordinates instead of the synthetic outside point: {"type":"position.update","latitude":-47.203945,"longitude":-126.300000,"accuracy_m":5.0} → position.accepted with inside: true, distance_m: 0.0, eligible_room: "cordon-seven".

  6. Send {"type":"room.join","room":"cordon-seven"} → room.snapshot:

JSON
{"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

PDF edition

Writeup PDF

Formatted edition of this walkthrough, built from my source notes · 3 pages.