# 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 ([[raw/medium.com/how-a-guessable-number-exposed-every-meta-ai-user-s-private-prompts-13878|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** ([[raw/agentoffense.com/bola-idor-testing-the-multi-account-object-swap-harness-15619|agentoffense]]). ## Object types and cases | Object | Case | |---|---| | Prompt revisions | Meta 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|Meta AI]]) | | Conversation history | travel 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|GraphQL AI chat]]) | | 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|JeeSite]]) | | Memory / RAG / graph refs | langchain4j-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|langchain4j-aideepin]]) | | Private skills via shared chat | sharing 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|shared AI chat]]) | | Gateway keys | Microsoft MCP Gateway: authorization bypass through user-controlled key (CWE-639 class) ([[raw/github.com/microsoft-mcp-gateway-authorization-bypass-through-user-controlled-key-14030|MCP Gateway]]) | | Cloud AI services | Brutecat'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|Cyberkendra]]) | 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 ([[raw/medium.com/the-1000-idor-hiding-behind-a-shared-ai-chat-15473|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 ([[raw/medium.com/i-changed-one-number-in-a-url-and-read-another-customer-s-pan-aadhaar-12597|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 ([[raw/aikido.dev/predicting-mongodb-objectid-continuously-in-rocket-chat-10181|Aikido]]). Brutecat's Claude+MCP pipeline passed 50% accuracy after endpoint clustering and one-click replay ([[raw/cyberkendra.com/researcher-used-ai-to-find-500000-worth-of-bugs-across-google-s-intern-9027|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 ([[raw/agentoffense.com/bola-idor-testing-the-multi-account-object-swap-harness-15619|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 ([[raw/agentoffense.com/bola-idor-testing-the-multi-account-object-swap-harness-15619|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 ([[raw/medium.com/how-a-guessable-number-exposed-every-meta-ai-user-s-private-prompts-13878|Meta AI]]). - Sharing a container must not transitively grant its referenced private objects. Re-check each sub-object ([[raw/medium.com/the-1000-idor-hiding-behind-a-shared-ai-chat-15473|shared AI chat]]). ## Related - [[Insecure Direct Object Reference]] - [[AI and LLM Security]] - [[AI Agent Authorization]] - [[MCP Security]] - [[LLM Data Exfiltration]] - [[Indirect Prompt Injection]] - [[Predictable Identifiers]] - [[Second-Order and Multi-Step IDOR]] ## Sources - [[raw/medium.com/how-a-guessable-number-exposed-every-meta-ai-user-s-private-prompts-13878|How a Guessable Number Exposed Every Meta AI User's Private Prompts]] - [[raw/agentoffense.com/bola-idor-testing-the-multi-account-object-swap-harness-15619|BOLA/IDOR testing: the multi-account object-swap harness]] - [[raw/medium.com/how-an-graphql-idor-leaked-ai-conversation-history-and-got-me-500-boun-15310|How an GraphQL IDOR leaked AI conversation History and Got me $500 bounty]] - [[raw/insightcve.com/cve-2026-119048-jeesite-ai-cms-chat-idor-exposes-conversations-13185|CVE-2026-119048: JeeSite AI CMS chat IDOR exposes conversations]] - [[raw/github.com/langchain4j-aideepin-idor-13876|langchain4j-aideepin IDOR]] - [[raw/medium.com/the-1000-idor-hiding-behind-a-shared-ai-chat-15473|The $1000 IDOR Hiding Behind a Shared AI Chat]] - [[raw/github.com/microsoft-mcp-gateway-authorization-bypass-through-user-controlled-key-14030|Microsoft MCP Gateway authorization bypass through user-controlled key]] - [[raw/cyberkendra.com/researcher-used-ai-to-find-500000-worth-of-bugs-across-google-s-intern-9027|Researcher Used AI to Find $500000 Worth of Bugs Across Google's Internal APIs]] - [[raw/medium.com/i-changed-one-number-in-a-url-and-read-another-customer-s-pan-aadhaar-12597|I Changed One Number in a URL and Read Another Customer's PAN, Aadhaar and Card PIN]] - [[raw/aikido.dev/predicting-mongodb-objectid-continuously-in-rocket-chat-10181|Predicting MongoDB ObjectId() continuously in Rocket.Chat]]