Heap of Secrets allocator-generation logic puzzle over one socket

pwn
flag RxR{d7476b7e-d1f9-42bc-8ab9-1f84515bd889}

A live "storeroom console" that models a two-bin allocator with generations. No binary shipped - pure logic pwn against a socket, and the whole randomised scenario only lives for one connection.

Note

The instance banner prints Verified flag: RxR{R4lly_i_g0t_215_kdn4h} - id 215 baked right in, the usual bait. The real flag is a per-instance UUID emitted by the report after a correct report.

The model

  • Two size bins: SHORT (1-48) and LONG (49-96).
  • layout shows the initial ready cells per bin, e.g. SHORT ready=C26@2,C73@1,C12@2 (cell id @ generation).
  • index lists "reels" (event logs), each with a prev= pointer and a stamp=.
  • reel <id> prints the header and events; stamp <id> says COMMIT or VOID.

From policy:

  • ALLOC takes the leftmost ready cell in the size bin and increments its generation.
  • DROP clears the owner and quarantines the cell.
  • RINSE releases the quarantine, bin-specific: SHORT appends in drop order (ready = ready + quarantined); LONG puts the newest quarantined cell first, then the rest reversed, then the old ready list.
  • PIN saves (owner, cell, generation); OBS records which pin was observed at that point.

The real gate: the committed chain

policy: "Follow the COMMIT child of ROOT, then the COMMIT child of each replayed reel. Chain membership requires the parent's membership." The reels form a tree where prev= is the parent link - from ROOT take the COMMIT child, then again the COMMIT child of that, skipping any VOID child and its whole subtree. Replaying events off-chain, or across the whole reel set, gives the wrong heap state entirely.

Win condition

Find the committed observation where an old pin's cell now holds a different VAULT object at a newer generation, plus a separate observation made while that cell was still in quarantine. Report:

output
report <witness> <pin> <cell> <old-owner> <new-owner> <old-gen> <new-gen> <quarantine-witness>

The quarantine-witness field is the disambiguator - several observations can show a pin's cell reused by a VAULT object, but only one has a companion observation taken during that cell's quarantine window.

Pitfall

State is per-session and the archive is randomised per connection - read, simulate and report all have to happen in one socket.

Result

session
report W12 P11 C35 A93 A67 14 15 W46
Report accepted.
RxR{d7476b7e-d1f9-42bc-8ab9-1f84515bd889}

Script (solve.py) connects, dumps layout/index/reels/stamps, builds the COMMIT chain, simulates it, picks the candidate pin with a quarantine-time observation, and sends the report - all in one shot.

Flag

output
RxR{d7476b7e-d1f9-42bc-8ab9-1f84515bd889}

Per-instance UUID, regenerated per container boot.