Ticketing
Challenge
A Node/Express ticketing app. A /debug route conveniently served its own source. The /add-ticket handler deep merged the request body into a ticket object with a recursive assign, and /admin checked req.user.admin === true.
| |
Approach
The recursive merge walks for (let key in source) with no guard on __proto__, so a crafted ticket body pollutes Object.prototype with admin: true. After that, the req.user.admin === true check on /admin passes and the admin page (and a debug/dev shell from there) is reachable.