ai newsDi., 1. Dez.

IDOR-Schwachstelle in KI-generierten Apps: Ein Blick in fremde Rechnungen per URL

Bei IDOR liefert eine Anwendung Datensätze allein anhand der angefragten ID zurück, ohne zu prüfen, ob der Datensatz dem Nutzer gehört. Ein Test mit zwei Konten zeigt in wenigen Minuten, ob die App fremde Daten wie etwa Rechnungen preisgibt.

dev.toSonntag 00:47 · 29.11.DE2 Min. Lesezeit
Bild: dev.to

IDOR stands for insecure direct object reference. It means your app returns or changes a record because the user asked for its ID, without checking that the record belongs to them. If /api/invoices/1042 works for anyone who is logged in, then /api/invoices/1043 probably shows someone else's invoice. AI-generated apps ship this often, because the code that "gets the invoice by id" is simple and the ownership check is an extra line nobody asked for.

app. get ( "/api/invoices/:id", requireLogin, async ( req, res ) => { const invoice = await db. invoice. findUnique ( { where: { id: req. params. id } } ); res. json ( invoice ); } ); Enter fullscreen mode Exit fullscreen mode Safer:

const invoice = await db. invoice. findFirst ( { where: { id: req. params. id, userId: req. user. id }, } ); if (! invoice ) return res. status ( 404 ). end ( ); Enter fullscreen mode Exit fullscreen mode 2. Where it shows up Read routes: invoices, orders, messages, files, profiles Update and delete routes: PATCH /api/projects/:id, DELETE /api/posts/:id File downloads by ID or by guessable file name Sequential numeric IDs, which make guessing easy Direct database reads from the browser, where the row policy only checks "is logged in" 3. A 5-minute two-account test Create two test accounts in your own app, A and B.

As A, create a record and copy the URL or request that fetches it. Sign in as B and send the same request with A's record ID. If B gets A's data, or can change or delete it, you have an IDOR.

Repeat for reads, edits and deletes on every resource type. Only test your own app with your own accounts.

A scan that never signs in cannot see records behind a login, so it cannot confirm or rule out IDOR. That is why the two-account test above matters. Treat a clean outside scan as one piece of the check, not the whole audit.

Check your own app from the outside, free. Run the free ProofForge scan on your live URL. No account needed for the first scan. It looks at your public site the way a stranger would and says pass, fail or inconclusive, so you know what is confirmed and what it could not see. One-time reports start at $9: see pricing. Building with an AI agent? There is an MCP server so it can check before it deploys.

Originaltitel: IDOR in AI-built apps: change one number in the URL and see someone else's data (a 5-minute two-account test)Quelle: dev.to (dev.to). Original öffnen