Code RoomSignup role escalation
HardPrep Room Coding #4404

Signup role escalation

Vibe & agenticSecurityMid–Senior~18 min

An AI built this FastAPI signup flow. The Pydantic model 'validates' the request, so the team assumed input was safe. A user signed themselves up as an admin with a free plan. Trace how, and fix the model.

Implement
bind_signup_payload(payload: list[str], allowed_fields: list[str]) → str
Examples
in[["email=a@b.com","password=hunter2"],["email","password"]]out"email=a@b.com;password=hunter2"
in[["email=a@b.com","password=hunter2","role=admin","plan=enterprise"],["email","password"]]out"rejected:plan,role"
in[["password=x","email=y"],["email","password"]]out"email=y;password=x"
What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.

0:00 of about 18 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.