The developer learned and signs the session object with HMAC, but left a legacy path that accepts an object with no signature. Strip the signature, send the object alone, and the server accepts it, so you forge the role freely.
The same session page, but the object is now HMAC-signed in the form object.signature. The flaw is the server verifies the signature only when present and trusts an unsigned object as a legacy path.
The server accepted an unsigned object and you became admin.
Why the solution worked
Verification conditioned on the signature being present is bypassed by removing it entirely; the unsigned legacy path defeats the protection. The fix is always rejecting any object without a valid signature.
The root cause
Signature verification happens only when a signature is present, and an unsigned path is trusted. The root is accepting unsigned state.
How the code is fixed
Make a valid signature always mandatory; never accept unsigned state.
Vulnerable code
const [payload, sig] = token.split('.');
if (sig !== undefined && sig !== hmac(payload)) reject(); // no sig => accepted
const obj = deserialize(payload);
Safe code
const [payload, sig] = token.split('.');
if (!sig || sig !== hmac(payload)) return reject(); // a valid signature is mandatory
const obj = deserialize(payload);
Impact in the real world
Signature stripping has bypassed signature protection in real systems and allowed forging sessions and tokens.
How defenders detect it
Defenders reject any state without a valid signature and alert on objects missing the signature part.
Your workspace now has a Server logs tab: your own attack, as the defender saw it, with the alerting lines marked.
Solved with the walkthrough. Put it aside and solve again to earn the feather.