mcp-cve-project

CVE-2025-61685 | @mastra/mcp-docs-server (directory listing / information exposure) | Medium |

CVE Information

Field Value
CVE / NVD CVE-2025-61685
Date (index) 2025-09-24
Affected product (index) @mastra/mcp-docs-server (directory listing / information exposure via path traversal logic flaw)
GHSA ID GHSA-xh92-rqrq-227v
OWASP MCP Top 10 (2025) MCP10 — Context Injection & Over-Sharing
Published / disclosed 2025-09-24
Ecosystem npm
Component @mastra/mcp-docs-server (Mastra Docs MCP Server)
EPSS score 0.005410000 (FIRST EPSS, 2026-07-16)
CVSS score Medium — CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N (GHSA; base 6.5)
CWE CWE-548 (Exposure of Information Through Directory Listing)
Affected versions <= 0.13.8 (advisory text also cites 0.13.18 and below)
Fixed versions 0.17.0
Fix status Patched
Exploit status Public advisory with PoC context (prompt-injection class)
Notes Disclosure credits Liran Tal. Exploitation is commonly chained with prompt injection in AI IDEs that auto-invoke MCP tools.

CVE Breakdown


What is the vulnerability?

@mastra/mcp-docs-server versions up to and including the vulnerable range mishandle path traversal checks in the docs tool. readMdxContent in src/tools/docs.ts rejects traversal attempts, but the execute handler still calls findNearestDirectory with the unsanitized path when content is not found, leaking directory listings outside the intended docs base directory (CWE-548).

Attack prerequisites / exposure

Typically requires an MCP client (for example Cursor) configured to run @mastra/mcp-docs-server via npx, plus attacker influence over tool arguments—often through prompt injection that steers the agent to pass traversal paths unchanged.

CVE is because of what bug?

A control-flow logic flaw: path validation in readMdxContent does not halt downstream suggestion logic, so blocked traversal paths still reach directory-enumeration helpers without equivalent validation.

MCP-specific impact / why it matters

Documentation MCP servers are treated as low-risk context providers, but this bug exposes filesystem structure (home directory layout, tool folders like .cursor/, cloud credential directories) into model context—useful for targeted follow-on attacks.

Where was the bug? (source + snippet)