Exposure of Information Through Directory Listing Affecting @mastra/mcp-docs-server package, versions <0.13.20


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.53% (41st percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-MASTRAMCPDOCSSERVER-13109617
  • published28 Sept 2025
  • disclosed24 Sept 2025
  • creditLiran Tal

Introduced: 24 Sep 2025

CVE-2025-61685  (opens in a new tab)
CWE-548  (opens in a new tab)

How to fix?

Upgrade @mastra/mcp-docs-server to version 0.13.20 or higher.

Overview

@mastra/mcp-docs-server is a MCP server for accessing Mastra.ai documentation, changelogs, and news.

Affected versions of this package are vulnerable to Exposure of Information Through Directory Listing via the execute function. An attacker can access sensitive directory listings by supplying crafted traversal paths, which are not properly validated after an initial security check fails. This can be exploited by submitting malicious input that causes the process to reveal the contents of arbitrary directories on the file system.

PoC

1. Configure Cursor IDE: In the .cursor/mcp.json file, define the Mastra MCP server:
{
    "mcpServers": {
      "mastra": {
        "command": "npx",
        "args": ["-y", "@mastra/mcp-docs-server"]
      }
    }
  }
2. Enable the MCP server within the IDE.
3. Initiate a new chat and use the malicious prompt provided above.
4. Observe the output, which will contain the directory listing from the root of the user's home directory.

CVSS Base Scores

version 4.0
version 3.1