IDOR and Broken Access Control in Next.js and Node.js: Object-Level Authorization That Holds [2026]
Your login is working, and that is exactly the problem: authentication tells you who is asking, not what they are allowed to touch. Broken Access Control has been the #1 category in the OWASP Top 10 since 2021, and IDOR is its most common concrete form — change one ID in the URL and read another tenant's invoice. Here's why JavaScript stacks leak object references, the seven rules that close the hole (session-derived scoping, the ownership predicate inside the query, 404 instead of 403, one authorization chokepoint), why middleware cannot save you, how Server Actions and RSC arguments become client input, and the two-account regression suite that keeps it shut.