Code RoomInvoice authorization bypass
MediumPrep Room Coding #4413

Invoice authorization bypass

Vibe & agenticSecurityMid–Senior~16 min

An AI added this Django view to fetch an invoice as JSON. The team gated the URL behind login, so they assumed it was safe. A customer changes the id in the URL and reads another company's invoice. What's missing, and what's the class of bug?

Implement
lookup_invoice_for_org(records: list[str], requester_org: str, invoice_id: str) → str
Examples
in[["inv-1|acme|12000","inv-2|globex|4500","inv-3|acme|900"],"acme","inv-1"]out"12000"
in[["inv-1|acme|12000","inv-2|globex|4500","inv-3|acme|900"],"acme","inv-2"]out"404"
in[["inv-1|acme|12000","inv-2|globex|4500","inv-3|acme|900"],"globex","inv-9"]out"404"
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 16 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.