{"id":"CVE-2026-49291","aliases":["CVE-2026-49291","GHSA-2r68-g678-7qr3","PYSEC-2026-2622"],"related":[],"kind":"vulnerability","state":"published","title":"mcp-memory-service: OAuth read-only clients can write and delete memories through MCP tools/call","summary":"mcp-memory-service is a semantic memory layer for AI applications. Prior to version 10.65.3, 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. Version 10.65.3 patches the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"mcp-memory-service is a semantic memory layer for AI applications. Prior to version 10.65.3, 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. Version 10.65.3 patches the issue.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nThe 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.\n\n## Technical Details\n\n`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.\n\nThe 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.\n\nThe REST endpoint demonstrates the intended boundary: `POST /api/memories` uses `Depends(require_write_access)` and rejects a read-only token with 403 `insufficient_scope`.\n\n## Reproduction\n\n1. Enable OAuth and disable anonymous access.\n2. Generate a valid OAuth JWT with only `scope: read`.\n3. Confirm the REST write endpoint rejects it:\n\n```http\nPOST /api/memories\nAuthorization: Bearer <read-only-token>\nContent-Type: application/json\n\n{\"content\":\"rest denied control\"}\n```\n\nExpected and observed: HTTP 403 with `Required scope 'write' not granted`.\n\n4. Send the same read-only token to the MCP endpoint:\n\n```http\nPOST /mcp\nAuthorization: Bearer <read-only-token>\nContent-Type: application/json\n\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"tools/call\",\n  \"params\": {\n    \"name\": \"store_memory\",\n    \"arguments\": {\n      \"content\": \"mcp read scope stored this\",\n      \"tags\": [\"poc\"]\n    }\n  }\n}\n```\n\nObserved: HTTP 200 JSON-RPC success and the storage `store` sink is reached.\n\n5. A read-only token can also call `delete_memory` through MCP if it knows a content hash:\n\n```http\nPOST /mcp\nAuthorization: Bearer <read-only-token>\nContent-Type: application/json\n\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 2,\n  \"method\": \"tools/call\",\n  \"params\": {\n    \"name\": \"delete_memory\",\n    \"arguments\": {\"content_hash\": \"<known_hash>\"}\n  }\n}\n```\n\nObserved: HTTP 200 JSON-RPC success and the storage `delete` sink is reached.\n\n## Impact\n\nA 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.\n\n## Affected Versions\n\nConfirmed present on current main commit `c99a922477df41f75a44db11182ae48a57311910` and latest release tag `v10.65.0` (`4eb4a62665589f9dd9f8c393afa32de434b4098a`).\n\n## Suggested Fix\n\nEnforce 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"mcp-memory-service es una capa de memoria semántica para aplicaciones de IA. Antes de la versión 10.65.3, el endpoint HTTP MCP JSON-RPC en ’/mcp’ requiere solo el ámbito ’read’ de OAuth para todas las solicitudes, luego despacha ’tools/call’ directamente a manejadores que incluyen herramientas mutantes. Un cliente OAuth de solo lectura puede llamar a ’store_memory’ y ’delete_memory’ a través de MCP, aunque los endpoints REST correspondientes requieran el ámbito ’write’. La versión 10.65.3 corrige el problema.","source":"nvd"}],"published":"2026-06-19T17:59:48.862Z","modified":"2026-10-25T23:10:00.167Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H","score":8.1,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H","score":8.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H","score":8.1,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H","score":8.1,"rating":"HIGH"}],"cwes":["CWE-862"],"affected":[{"ranges":[{"version":"< 10.65.3","status":"affected"}],"vendor":"doobidoo","product":"mcp-memory-service","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"10.65.3"}],"ecosystem":"PyPI","package":"mcp-memory-service","purl":"pkg:pypi/mcp-memory-service","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"10.65.3"}],"ecosystem":"PyPI","package":"mcp-memory-service","purl":"pkg:pypi/mcp-memory-service","source":"pysec"}],"references":[{"url":"https://web.archive.org/web/20260508112116/https://github.com/doobidoo/mcp-memory-service/","tags":["x-refsource-confirm"],"sources":["cvelist","nvd"]},{"url":"https://github.com/doobidoo/mcp-memory-service/security/advisories/GHSA-2r68-g678-7qr3","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://pypi.org/project/mcp-memory-service/10.65.3","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-49291","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/doobidoo/mcp-memory-service","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://web.archive.org/web/20260508112116/https://github.com/doobidoo/mcp-memory-service","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/mcp-memory-service","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-2r68-g678-7qr3","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-06-22T17:07:36.136Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-49291","url":"https://www.cve.org/CVERecord?id=CVE-2026-49291","licence":"CVE Terms of Use","modified":"2026-06-22T17:07:55.536Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-2r68-g678-7qr3","url":"https://github.com/advisories/GHSA-2r68-g678-7qr3","licence":"CC-BY-4.0","modified":"2026-07-13T16:42:40.292Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-49291","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-49291","licence":"Public domain","modified":"2026-10-25T23:10:00.167Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2622","url":"https://osv.dev/vulnerability/PYSEC-2026-2622","licence":"CC-BY-4.0","modified":"2026-07-13T16:32:13.084Z"}],"updatedAt":"2026-11-25T22:59:25.277Z","epss":{"score":0.00488,"percentile":0.34764,"date":"2026-11-30T12:00:22.000Z"}}