VBS-2026-0008HIGHCVSS 7.7CWE-639

Insecure direct object reference on AI-generated CRUD endpoints

AI tools generate CRUD endpoints that accept user-supplied IDs but do not verify ownership. Any authenticated user can read, modify, or delete another user's records by guessing or enumerating sequential/UUID IDs.

Published
2026-02-20
Discovered By
PolyDefender Research
CVSS Score
7.7 / 10
Affected AI Platforms
LovableBolt.newv0ChatGPTCursorGitHub Copilot
Affected Tech Stack
Next.jsExpressPrismaDrizzle
Proof of Conceptpoc.ts
// app/api/posts/[id]/route.ts
export async function GET(req, { params }) {
  const post = await db.posts.findUnique({ where: { id: params.id } })
  // ↑ No check that post.userId === currentUser.id
  return NextResponse.json(post)
}
Remediation

Always filter by both the resource ID and the authenticated user's ID: WHERE id = $1 AND user_id = $2. Never trust a client-supplied ID without verifying ownership.

#idor#authorization#api#ai-generated
Check if your app is vulnerable to VBS-2026-0008

PolyDefender detects this and dozens of other AI-specific vulnerability patterns.

FAQ
Q

How do I check if my Next.js + Express app is affected by insecure direct object reference on AI-generated CRUD endpoints?

A

AI tools generate CRUD endpoints that accept user-supplied IDs but do not verify ownership. Search your codebase for Next.js, Express, Prisma, Drizzle patterns and verify the remediation has been applied.

Q

Why does Lovable and Bolt.new generate code with CWE-639 (high severity)?

A

AI tools generate CRUD endpoints that accept user-supplied IDs but do not verify ownership. Any authenticated user can read, modify, or delete another user's records by guessing or enumerating sequential/UUID IDs.

Q

How do I fix insecure direct object reference on AI-generated CRUD endpoints?

A

Always filter by both the resource ID and the authenticated user's ID: WHERE id = $1 AND user_id = $2. Never trust a client-supplied ID without verifying ownership.

Q

What can an attacker do if my app contains VBS-2026-0008?

A

With CVSS 7.7 (high), this vulnerability is high risk — significant data or functionality can be compromised. Any authenticated user can read, modify, or delete another user's records by guessing or enumerating sequential/UUID IDs..