IDOR checker for Next.js API routes

Drop your app folder or paste a route handler to find records looked up by a request id with no ownership check, and routes with no auth check at all.

Run the check

Drop a project folder or files here

node_modules, .git, virtualenvs and build folders are skipped. Limit 25 MB / 5,000 files.

The Python engine (Pyodide, a few MB, cached by your browser) loads when you start.

The mistake

Checking that the caller is logged in, then loading, updating or deleting a record using an id from the URL, query string or body (/api/posts/42) without also filtering on the logged-in user.

Why it is dangerous

Any signed-in user can change the id and read, edit or delete everyone else's records. This is Broken Object Level Authorization (OWASP API #1), and it is the most common hole in generated CRUD code. Routes that change data with no authentication check at all, and user ids or roles taken from the request body instead of the session, are just as easy to abuse with a single curl.

How to fix it

Put the owner into the query itself, so a record that is not yours is simply not found (return 404), or load it and compare its owner with the session user (403):

Prisma:      prisma.post.delete({ where: { id, authorId: session.user.id } })
Drizzle:     .where(and(eq(posts.id, id), eq(posts.userId, session.user.id)))
Mongoose:    Post.findOneAndDelete({ _id: id, owner: req.user.id })
SQLAlchemy:  db.query(Item).filter(Item.id == item_id, Item.owner_id == current_user.id).first()
Django:      get_object_or_404(Post, pk=pk, owner=request.user)

What this checker looks for

This page runs route-auth-check, which reads Next.js, Express, Fastify, Hono, FastAPI, Flask and Django routes. The rules most relevant to this page:

RuleWhat it finds
RAC002Record looked up by a request id with no ownership check (IDOR)
RAC001Route changes data without any authentication check
RAC004Next.js middleware does not cover the routes it seems meant to protect
RAC005Admin route checks login but not the caller's role
RAC006User id or role taken from the request instead of the session
RAC008Whole request body written to the database (mass assignment)

Every finding has a rule id, a severity, file:line, the offending line (secrets masked), why it matters and how to fix it. Run route-auth-check rules for the full list.

FAQ

Is the IDOR rule exact?

It is a heuristic (marked as such in the results): it looks for a lookup by a request id with no owner filter or owner comparison nearby. Confirm each finding against your data model.

Does it understand middleware.ts?

Yes. It reports Next.js middleware whose matcher does not cover the routes it seems meant to protect, such as the common matcher that excludes every /api route.

Are my files uploaded anywhere?

No. The checker is Python running inside your browser tab (Pyodide, WebAssembly). Your files are read with the browser's File API and written into an in-memory file system that exists only in this tab. Your files are never sent anywhere. The only network requests load the Python runtime and the checker code, plus Google Analytics page-view counting, which never sees your files. You can disconnect from the internet after the engine has loaded and the scan still works.

Is a clean report a guarantee?

No. It is a static check for known patterns, not a penetration test. A clean report means none of these patterns were found, nothing more.

Can I run the same check on my machine or in CI?

Yes. Every checker on this site is an open-source command-line tool (MIT licence, Python 3.10+ standard library only). The results here are the same as `scan --json` on the command line, except for checks that need git (whether a file is committed or ignored), which cannot run in a browser.