Summary
A high-severity insecure direct object reference vulnerability affects memory tools in Amazon Strands Agents. An authenticated remote user may access, modify, or delete another tenant's memories if an LLM is influenced to generate a tool call containing a forged namespace parameter.
Affected context
The issue occurs in the mongodb_memory, elasticsearch_memory, and mem0_memory tools when tenant or namespace boundaries depend on a caller-influenced tool parameter. Deployments are at risk when the application accepts LLM-generated tool calls without independently binding the namespace to the authenticated user's tenant and enforcing authorization at the data-access layer.
Exploit preconditions
- Attack surface: Remote memory-management tool interfaces exposed through an agent workflow
- Required access: An authenticated user who can interact with the affected agent or invoke workflows that use these tools
- Trigger point: Processing a tool call containing a namespace parameter
- Why exploitation is possible: The requested namespace may be trusted without an authoritative server-side check tying it to the authenticated tenant, allowing cross-tenant object references
Why this happens
The vulnerability is caused by relying on a client- or model-supplied identifier to select tenant-scoped memory records without enforcing ownership independently. This is an insecure direct object reference mapped to CWE-639, where an application exposes or operates on an internal object based on an attacker-influenced reference and fails to verify authorization for that object.
Potential impact
- An authenticated user may read memories belonging to another tenant
- An attacker could modify or delete another tenant's stored memories
- Agent behavior and context could be influenced through cross-tenant memory tampering
- Sensitive tenant data may be exposed
- Persistent data integrity and availability could be affected
General mitigation guidance
Mitigation generally focuses on making tenant identity server-controlled rather than model-controlled.
Defensive design patterns include:
- Deriving the effective tenant or namespace from authenticated session context
- Treating LLM-generated tool arguments as untrusted input
- Enforcing object-level authorization at every memory read, write, and delete operation
- Using separate storage boundaries or scoped credentials where practical
- Applying least privilege to agent tools and data-access identities
- Logging and rejecting namespace mismatches instead of silently accepting them
These controls reduce reliance on prompt behavior and preserve authorization boundaries even when tool arguments are manipulated.
How teams detect issues like this
Organizations can look for this weakness through:
- Static analysis and code review checks for authorization decisions based directly on tool or model-supplied tenant identifiers
- Tests that attempt cross-tenant reads, updates, and deletions using altered namespace values
- Policy checks requiring authenticated tenant context to be injected server-side
- Runtime monitoring for namespace mismatches, denied object-level authorization checks, and unusual cross-tenant access patterns
Automated security review tools may help identify data-access paths where object ownership is not independently validated.

