Skip to content

Access control

Record fetched by an id from the request, with no owner checkaccess.missing-ownership-check

The handler checks that someone is signed in, then looks a record up by an id the caller sent — but nothing ties the record to that user. Any signed-in user can change the id in the URL and read or edit someone else's data (an IDOR, the most common API bug in production apps).

  • In force Rule access.missing-ownership-check
  • 3 clauses

At a glance

access.missing-ownership-check
Severitymedium
CertaintyNeeds review — a heuristic; confirm before changing code
Looks atyour source code
When it runsRuns on every scan

How to fix it

Add the signed-in user to the query (`where id = ? and userId = session.user.id`) or compare the record's owner before returning or changing it.

Check your own app

Run npx scanlyfix scan in your project. Every finding gets an id; after fixing, npx scanlyfix verify <id> proves it is gone.

If it is a false positive in your project, silence that one line with // scanlyfix-ignore-next-line access.missing-ownership-check -- <why>.

All rules

Your code stays
on your machine

Only findings are uploaded, and only to your own dashboard.