Unprotected API route

    What is an unprotected API route?

    SHORT ANSWER

    An unprotected API route is a backend address that anyone on the internet can call, because it never checks who's asking. It might return private data, change a record or send an email, and it needs no login at all.

    Also called: Missing authentication

    ON THIS PAGE

    What it means

    Your front end calls your backend through addresses like /api/users or /api/export. The pages might need a login, but the routes behind them often don't, and a person can type those addresses into a browser or script directly.

    Route protection must live on the server. A hidden button or a page that redirects to a login screen only affects what real visitors see.

    Why it matters for vibe-coded apps

    AI tools build the screen and the route separately. The screen asks for login, but the route is often left open, especially for routes added later.

    IF THIS IS WRONG IN YOUR APP
    • Private data can be downloaded without an account.
    • Anyone can trigger actions, like emails, exports or deletions.
    • Routes meant for admins can be called by the public.

    Example

    An export route for admins.

    ✕ RISKYNo check at all
    app.get("/api/admin/export-users", async (req, res) => {
      res.json(await db.users.findAll());
    });
    ✓ SAFERLogin and admin role checked on the server
    app.get("/api/admin/export-users", requireLogin, requireRole("admin"), async (req, res) => {
      res.json(await db.users.findAll());
    });

    Make "protected by default" your rule: add a login check globally and open up only the routes that must be public.

    How to check if your app has this problem

    1. 1List every route in your backend, then call each one with no login (a browser address bar works for GET routes).
    2. 2Look at free checks for common paths such as /api/admin, /api/users and /api/export.

    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 a login check as the default for all routes.
    2. 2Add a role check to admin routes.
    3. 3Remove old test and debug routes.
    4. 4Run a check again to confirm they're locked.
    FIX PROMPT · PASTE INTO YOUR AI TOOL

    List every API route in my backend and whether it requires login. Make login required by default, add role checks to admin routes, and delete any debug or test routes that aren't needed.

    Check if your app has this problem

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

    Last updated