NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Other MCP servers and tools

CVE-2026-49291: mcp-memory-service: OAuth read-only clients can write and delete memories through MCP tools/call

highCVSS 3.1 8.1GHSA-2r68-g678-7qr3

mcp-memory-service up to 10.65.1 lets an OAuth client with only the `read` scope store and delete memories through the `/mcp` JSON-RPC endpoint. The REST API correctly demands `write`, but the MCP `tools/call` path does not. Upgrade to 10.65.3.

Published Jun 26, 2026 · Analysis Oct 25, 2026

What an attacker can do

In src/mcp_memory_service/web/api/mcp.py, mcp_endpoint depends on require_read_access. For tools/call it takes the tool name and arguments and calls handle_tool_call(storage, tool_name, arguments). It passes no user and checks no per-tool scope. The tool registry mixes read tools with store_memory, which calls storage.store(...), and delete_memory, which calls storage.delete(content_hash).

The REST route POST /api/memories uses require_write_access and returns 403 insufficient_scope for the same token. The same read-only token sent to /mcp gets HTTP 200 and the write goes through. Deletion needs a known content hash.

The attacker needs a valid OAuth token with read scope, so the instance must have OAuth on and anonymous access off for this to be the relevant boundary. The result is integrity and availability damage: someone meant to only read can inject memories or erase stored ones. Because agents load these memories as context, injected entries can steer later agent behavior, which makes this a way to plant instructions.

Who is affected

mcp-memory-service 10.65.1 and earlier, as listed in the advisory. The reporter confirmed the flaw on release v10.65.0 and on the main branch at the time. It applies to deployments that serve the HTTP /mcp endpoint with OAuth and hand out read-only tokens.

pip show mcp-memory-service

mcp-memory-service

Ecosystem
PyPI
Affected
<= 10.65.1
Fixed in
10.65.3
Check
pip show mcp-memory-service

How to fix it

Upgrade to mcp-memory-service 10.65.3.

pip install --upgrade mcp-memory-service==10.65.3

The advisory does not describe the implementation of the fix. Its suggested remedy is per-tool authorization at tools/call time, with write required for store_memory and delete_memory. It lists no workaround. Until you upgrade, treat every read-scope token as if it had write access, and limit who holds one.

How to tell if you were hit

Review the memory store for entries you did not create, such as content tagged poc, and for memories that have vanished. Check HTTP access logs for POST requests to /mcp whose body names store_memory or delete_memory, then match them to the token or client identity. Compare those clients' granted scopes with the actions logged. Entries written through /mcp by read-only clients are the signal.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

The HTTP MCP JSON-RPC endpoint at /mcp requires only OAuth read scope for all requests, then dispatches tools/call directly to handlers that include mutating tools. A read-only OAuth client can call store_memory and delete_memory through MCP even though the corresponding REST endpoints require write scope.

Technical Details

src/mcp_memory_service/web/api/mcp.py declares mcp_endpoint with user: AuthenticationResult = Depends(require_read_access). For tools/call, it extracts the requested tool name and arguments, then calls handle_tool_call(storage, tool_name, arguments) without passing the authenticated user or checking a per-tool required scope.

The MCP tool registry includes both read tools and write tools. In the same handler file, store_memory creates a Memory object and calls storage.store(...), while delete_memory calls storage.delete(content_hash). These operations are reachable with only the read scope.

The REST endpoint demonstrates the intended boundary: POST /api/memories uses Depends(require_write_access) and rejects a read-only token with 403 insufficient_scope.

Reproduction

  1. Enable OAuth and disable anonymous access.
  2. Generate a valid OAuth JWT with only scope: read.
  3. Confirm the REST write endpoint rejects it:
POST /api/memories
Authorization: Bearer <read-only-token>
Content-Type: application/json

{"content":"rest denied control"}

Expected and observed: HTTP 403 with Required scope 'write' not granted.

  1. Send the same read-only token to the MCP endpoint:
POST /mcp
Authorization: Bearer <read-only-token>
Content-Type: application/json

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "store_memory",
    "arguments": {
      "content": "mcp read scope stored this",
      "tags": ["poc"]
    }
  }
}

Observed: HTTP 200 JSON-RPC success and the storage store sink is reached.

  1. A read-only token can also call delete_memory through MCP if it knows a content hash:
POST /mcp
Authorization: Bearer <read-only-token>
Content-Type: application/json

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "delete_memory",
    "arguments": {"content_hash": "<known_hash>"}
  }
}

Observed: HTTP 200 JSON-RPC success and the storage delete sink is reached.

Impact

A client intended to be read-only can inject or delete memories through the MCP API. This can corrupt the memory database, influence future agent context, and destroy stored user memories without the OAuth write scope required by the REST API.

Affected Versions

Confirmed present on current main commit c99a922477df41f75a44db11182ae48a57311910 and latest release tag v10.65.0 (4eb4a62665589f9dd9f8c393afa32de434b4098a).

Suggested Fix

Enforce authorization per MCP tool at tools/call time. Require write for store_memory and delete_memory, keep read only for read-only tools, and add regression tests proving direct tools/call to mutating tools is rejected before the handler reaches storage when the caller has only read scope.

Credited to DavidCarliez.

Questions

Does this need a valid token?

Yes. The caller needs an OAuth token with at least the read scope. The flaw is that this lowest scope is enough to write and delete through MCP.

Is the REST API affected too?

No. POST /api/memories correctly rejects a read-only token with 403 insufficient_scope. Only the /mcp tools/call path skips the check.

Which release fixes CVE-2026-49291?

10.65.3. Releases up to 10.65.1 are listed as affected.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Other MCP servers and tools vulnerabilities

All Other MCP servers and tools entries