Here is a handler from a small invoicing app.
export async function getInvoice(req, res) {
const user = await requireUser(req)
const id = req.params.id
const invoice = await db.invoices.find(id)
return res.json(invoice)
} Read it twice. It checks that someone is signed in. It never checks that the invoice belongs to them. Any customer who changes the number at the end of the address can read someone else's invoice: their name, their address, what they bought and what they paid.
Why it gets through review
Nothing on the page looks wrong. There is an authentication call on the second line, so the reviewer's eye registers "this is protected" and moves on. The tests sign in as the owner of the invoice and fetch it, so they pass. The flaw only shows up when two different people use the app at once, which is exactly the situation a test written by one developer rarely creates.
That is why the industry gives it two names. In a web app it is usually called an insecure direct object reference (IDOR). In an API it is broken object level authorization (BOLA). Both describe the same thing: the app trusts an identifier it should have checked.
How common it is
Broken access control sits at number one in the OWASP Top 10, the list most security teams and auditors work from. When OWASP compiled the 2021 edition, 94% of the applications in its data had been tested for some form of it. In the OWASP API Security Top 10 (2023), broken object level authorization is first again.
It is also the flaw that makes the news, because it does not need skill to exploit. There is no clever payload. Somebody notices a number in a web address and tries the next one.
The fix is one condition
const invoice = await db.invoices.find({ id, owner: user.id })
if (!invoice) return res.status(404).end() Ask for the invoice and its owner in the same query. If it is not yours, the app answers as if it does not exist. Return "not found", not "forbidden": a "forbidden" tells the person asking that the invoice is real.
The better fix is to make the mistake impossible to write. Put every query that touches customer data behind one helper that takes the owner or the organisation, and have that helper refuse to run when the value is missing. Then forgetting the check is an error you see at once, not a leak you find out about later. We run our own service this way, and say so on our security page.
How to catch it
You can test for it yourself in five minutes. Sign up twice, as two different people. As the second person, open a record that belongs to the first by changing the identifier in the address or in the API call. If it opens, you have this bug.
AIpento's live tests include a set built for exactly this class of flaw, mapped to OWASP A01 and API1: requests that try to reach one account's records from another, and to act above a role. They run against a staging copy of your app that you have authorised in writing, using test accounts you give them. A finding is reported only with the exact request and response that proved it.
Then AutoFix writes the one-line change, and the change is accepted only when your test suite passes three times from three clean checkouts.