IDOR in AI Applications

Object-level authorization failures on the objects LLM products create: conversations, prompt revisions, shared chats, skills/system instructions, memory and RAG references. Also covers agents and MCP tools that fetch objects by IDs taken from model context.

How it works

AI products create many new objects per interaction, and each needs an ID that ends up in traffic. Every prompt edit or regeneration mints a new record (Meta AI). These objects hold sensitive data: chat transcripts, private instructions, long-term memory, knowledge-base chunks. They’re reached through fresh, fast-moving endpoints, often GraphQL, where ownership checks lag. Agents add a second path. The ID comes from model context rather than a UI, so an injected instruction can name another tenant’s object and an over-privileged tool fetches it as a confused deputy (agentoffense).

Object types and cases

ObjectCase
Prompt revisionsMeta AI: edited-prompt IDs were near-sequential; changing one returned a stranger’s prompt and generated output. Reported 2024-12-26, fixed 2025-01-24, $10,000 ([[raw/medium.com/how-a-guessable-number-exposed-every-meta-ai-user-s-private-prompts-13878
Conversation historytravel assistant GraphQL papayaConversationHistory(conversationID:) returned any user’s conversation; the UUID was in the ?conversation= URL, $500 ([[raw/medium.com/how-an-graphql-idor-leaked-ai-conversation-history-and-got-me-500-boun-15310
Chat transcripts (R/W/D)JeeSite 5.11.0–5.19.1 (CVE-2026-119048): /a/cms/chat/message read, /a/cms/chat/delete destroy, /a/cms/chat/completions append to another user’s conversation; ownership checks missing and one reversed ([[raw/insightcve.com/cve-2026-119048-jeesite-ai-cms-chat-idor-exposes-conversations-13185
Memory / RAG / graph refslangchain4j-aideepin ≤3.32.0 (CVE-2026-125386): another user’s message UUID to knowledge-embedding-ref, memory-embedding-ref, graph-ref → KB chunks, long-term memory text, knowledge-graph data ([[raw/github.com/langchain4j-aideepin-idor-13876
Private skills via shared chatsharing a chat exposed a private skill UUID in the feed; POST /skills/{uuid}/diagram returned the private instructions even though the skill API denied direct reads. Two same-org regular users, $1,000 ([[raw/medium.com/the-1000-idor-hiding-behind-a-shared-ai-chat-15473
Gateway keysMicrosoft MCP Gateway: authorization bypass through user-controlled key (CWE-639 class) ([[raw/github.com/microsoft-mcp-gateway-authorization-bypass-through-user-controlled-key-14030
Cloud AI servicesBrutecat’s Google API sweep included Vertex AI Search among services with IDOR/BAC findings ([[raw/cyberkendra.com/researcher-used-ai-to-find-500000-worth-of-bugs-across-google-s-intern-9027

The shared-chat case is a reference-leak across permission boundaries. “Can view a shared chat” and “can read the skill behind it” are different permissions, and a secondary endpoint that accepts the leaked UUID merges them (shared AI chat). This is the same pattern as Second-Order and Multi-Step IDOR.

AI-generated code and AI-driven testing

  • AI-generated CRUD apps “usually work” but often skip authorization. A Flask finance demo generated with AI shipped GET /profile?user_id= with sequential IDs exposing PAN/Aadhaar/card PIN (SwarnaVault).
  • AI pentest agents find IDOR when given replayable probes. Aikido’s agent flagged the Rocket.Chat unauthenticated file access that led to ObjectId prediction (Aikido). Brutecat’s Claude+MCP pipeline passed 50% accuracy after endpoint clustering and one-click replay (Cyberkendra). See AI Coding Assistant Risks.

Testing

  • Map every object the AI feature creates: conversation, message, revision, attachment, skill/agent, memory entry, share link, export.
  • Swap IDs on read and on append/regenerate. An append IDOR injects content into another user’s context, which feeds Indirect Prompt Injection.
  • Treat share links as ID sources. Check each referenced sub-object (skills, files, tools) against its own permission.
  • For agents/MCP: plant a document telling the agent to fetch a second tenant’s object, run as a first-tenant user, and read the tool-call trace (agentoffense).

Defenses

  • Authorize tool calls against the end user the agent acts for, not the agent’s service account; treat model-supplied arguments as untrusted input (agentoffense). See AI Agent Authorization, MCP Security.
  • Random, non-sequential IDs for prompts and revisions, plus an owner check on every endpoint that resolves them (Meta AI).
  • Sharing a container must not transitively grant its referenced private objects. Re-check each sub-object (shared AI chat).

Sources