Broken access control

    What is broken access control?

    SHORT ANSWER

    Broken access control means your app lets people do or see things they shouldn't, even though they're logged in correctly. A normal user opens another user's data, or reaches an admin page, because the app checked who they were but not what they're allowed to do.

    Also called: Missing authorization, BOLA

    ON THIS PAGE

    What it means

    Logging in answers the question "who are you?". Access control answers "what are you allowed to do?". Many apps get the first right and skip the second.

    It shows up as a user changing a number in a web address to see someone else's order, a button hidden in the page that still works if called directly, or an admin route that only checks that a user is logged in.

    Why it matters for vibe-coded apps

    It's the most common serious web security problem, and AI tools make it easy to create: they build screens that look right, but the server behind them often trusts whatever the browser asks for.

    IF THIS IS WRONG IN YOUR APP
    • One customer can read, change or delete another customer's data.
    • Hiding a button is not protection: anyone can call the route behind it directly.
    • Admin-only features can be reached by ordinary users.

    Example

    An endpoint that returns an invoice.

    ✕ RISKYAny logged-in user can fetch any invoice
    app.get("/api/invoices/:id", requireLogin, async (req, res) => {
      const invoice = await db.invoices.findById(req.params.id);
      res.json(invoice);
    });
    ✓ SAFERThe server checks the invoice belongs to the caller
    app.get("/api/invoices/:id", requireLogin, async (req, res) => {
      const invoice = await db.invoices.findOne({
        id: req.params.id,
        userId: req.user.id, // only their own
      });
      if (!invoice) return res.status(404).end();
      res.json(invoice);
    });

    Enforce the rule on the server, or in the database with row level security. Never rely on the front end to hide things.

    How to check if your app has this problem

    1. 1Log in as one test user, copy the web address of one of their records, then open it while logged in as a second user.
    2. 2Look at each route that reads or changes data and check it compares the record's owner to the logged-in user.

    The quicker way: LetMeCheck tests for this automatically, from the outside, the way an attacker would.

    Run a free scan →

    How to fix it

    1. 1Add an owner check to every route that reads or changes a record.
    2. 2Put the admin check on the server, not just on the page.
    3. 3Turn on row level security so the database enforces the same rule.
    4. 4Test with two accounts and run a check again.
    FIX PROMPT · PASTE INTO YOUR AI TOOL

    Review every API route and database query in my app for missing access control. Make each one confirm that the record belongs to the logged-in user (or that the user has the admin role) on the server, and return a 404 or 403 otherwise.

    Check if your app has this problem

    Paste your website and we'll check for broken access control issues and other common issues in AI-built apps. Free, about a minute, and nothing on your site is changed.

    Last updated