Source: https://everyrole.dev/blog/idor-testing

# IDOR testing: open another user’s item by its URL

IDOR testing in one move. Log in as a second user, type the address of the first user’s item, and the app must answer not found. How to run it on every deploy.

Nov 22, 2026  6 min read  by the EveryRole team

IDOR testing is one move: log in as a second user, type the address of something that belongs to the first user, and look at what comes back. If you see the first user’s item, your app has an insecure direct object reference. The fix belongs to a developer. The check is plain QA, it takes two test accounts, and it should [run after every deploy](https://everyrole.dev/blog/run-tests-after-deploy), because this bug comes back.

Security guides file this under broken access control testing, and OWASP’s Top 10 has put broken access control first since 2021. We’ll stay on the testing side: how to see it, what the right answer looks like, and how to keep checking.

## An insecure direct object reference example

Our practice app has items. Each editor sees their own on “Your items”. The first editor creates one. It gets the address `/items/1`.

Now the second editor logs in. Their list is empty, as it should be.

![The practice app's list for the second editor: the heading "Your items", a "New item" link, and "No items yet".](https://everyrole.dev/s/blog/idor-testing/other-editor-list.webp)

The second editor’s list. Nothing here links to the first editor’s item.

Nothing on this page leads to `/items/1`. A tester who clicks through the app as the second editor will never reach it, and will report that editors can’t see each other’s items.

Then the second editor types `/items/1` into the address bar. We switched off the practice app’s owner check for this picture, to show what the bug looks like:

![The practice app, with its owner check switched off, answering the second editor at the first editor's item: the heading "Sample item", the note "A short sample note", an Edit link and a Delete button.](https://everyrole.dev/s/blog/idor-testing/leaky-opens.webp)

The first editor’s item, open for the second editor, with Edit and Delete. The list hid it. The address didn’t.

The name, the note, and the controls. The edit form opens for them too, with the name filled in.

That is the whole bug. The list was filtered by owner. The item’s page was not. Hiding the link is not refusing the page.

## IDOR testing by hand: change the id in the URL

You need two test accounts with the same rights. Two editors, two customers, two free users. One account with more rights than another is a different test, [the access matrix](https://everyrole.dev/blog/permission-testing-access-matrix), and it won’t find this.

1. **As the first user, create something** and copy its address. Note any id in it: `/items/1`, `/invoices/8841`, `?order=302`.
2. **Log out. Log in as the second user.** Use a private window so no cookie of the first is left.
3. **Paste the address.** Then try its neighbours: the edit page (`/items/1/edit`), the download link, the print view.
4. **Read the answer** against the list in the next section.
5. **Go back as the first user** and check the thing is unchanged.

Do it for each kind of thing a user owns: items, files, invoices, profiles, exports. One of each is enough to start. That is all “change the id in the URL” means.

A random-looking id does not save you. Long ids make an address hard to guess. They are also shared in emails, pasted in chats and stored in browser history. The page still has to ask who is asking.

## What the right answer looks like

With the owner check on, the same address answers this:

![The practice app, with its owner check on, answering the second editor at the first editor's item: the heading "Not found", "There is no such page.", and a link "Back to your items".](https://everyrole.dev/s/blog/idor-testing/closed-not-found.webp)

The same address, the same second editor, the check switched on: the app’s own not-found page.

A good answer has four parts:

- **A not-found or refused status.** Here a 404. A 200 with an empty page is a bug that passes status checks.
- **Nothing of the thing.** Not its name in the page title, not its note in a hidden field.
- **The same answer as for an id that doesn’t exist.** We compared: in the practice app, the page for someone else’s item and the page for `/items/999` are byte for byte the same. If the two differ, a stranger can tell which ids are real.
- **A way back.** The second user did nothing wrong by their own lights. Give them a link.

Write those four into the expected result of [the test case](https://everyrole.dev/blog/how-to-write-test-cases). “Access denied” on its own will be passed by a login redirect, a blank page and a server error, and that is [a hollow pass](https://everyrole.dev/blog/hollow-passes).

## Why it has to run on every deploy

Nobody decides to remove an owner check. It goes missing. A new page is added and copies the query without the filter. A refactor moves the check into a helper and one route doesn’t call it. An export endpoint is written in a hurry.

And nothing tells you. The first user sees their item as before. The second user sees their own list as before. No error is logged, because serving a page is not an error. The person who finds it is whoever types an address by hand, and you had better hope they write to you.

So this is a regression check, not a one-time audit. The manual test above is five steps for one kind of thing. Nobody repeats five steps per kind of thing after every deploy. It needs to run by itself.

## What this test doesn’t cover

To keep the claim honest: this is the read side from the browser. A full review also tries the write requests directly (sending the edit or the delete for someone else’s id without opening any page) and the API behind the pages, if you have one. That takes developer tools or a script, and a security tester will go further still. The address-bar test is the part every team can do today, and it is the part that is easiest to skip.

## How EveryRole runs this check

EveryRole checks which kind of user can open which page, from the outside, on the live site. For things a user makes, it goes further than pages.

When a journey creates something with a page of its own, say the editor’s new item, the run keeps that item’s address. After the editor’s part, each other kind of user you gave a test login for, and a visitor, opens that same address, and the run checks that what the editor made doesn’t show for them. It looks for the words it typed into that item. The status and the “same as a missing id” comparison stay on your list. Then the run deletes what it made.

To get the wall between two people of the same role checked, add a second editor as a kind of user of its own, with its own test login. That second account is the one to make today.

We test this on ourselves. The switch we used for the picture above is part of our own test suite: it runs the practice app with the owner check off, and our build fails unless that run reports the open item.

Its limit is the one in the section above. It opens the address as the other user and looks. It doesn’t forge an edit or a delete request for someone else’s id.

## Try it on your own app

EveryRole tests your app’s real user journeys for each kind of user, from the live site, and runs them after every deploy. Paste your app’s address to see what it finds.

[Start with your app](https://everyrole.dev/signup) [How it works](https://everyrole.dev/docs#start)

## Keep reading

Roles and permissions

### [Permission testing: build an access matrix for your app](https://everyrole.dev/blog/permission-testing-access-matrix)

Permission testing starts with a table: pages down, kinds of user across. Fill in every cell, then test every cell. The ones you can’t fill are the risk.

Nov 22, 2026  5 min read

Roles and permissions

### [Test accounts for each role, kept safe](https://everyrole.dev/blog/test-accounts-for-each-role)

Test accounts for QA: one per kind of user, made for testing, never a real person’s, with the least rights that do the job.

Nov 22, 2026  5 min read

Roles and permissions

### [Role-based testing: your app is several apps](https://everyrole.dev/blog/role-based-testing)

Role based testing means running each journey as every kind of user, each with its own expected result. One suite run as admin tests one of your apps.

Nov 22, 2026  5 min read
