CVE-2025-61685 Mastra Docs MCP Server `@mastra/mcp-docs-server` Leads to Information Exposure

Medium 6.5 Published Updated

An attacker can bypass security checks to list arbitrary directory contents on the user's filesystem, exposing sensitive structural information.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-61685?

CVE-2025-61685 is a medium-severity path traversal vulnerability in mastra-ai mastra, published on 3 Oct 2025. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

Mastra is a Typescript framework for building AI agents and assistants. Versions 0.13.8 through 0.13.20-alpha.0 are vulnerable to a Directory Traversal attack that results in the disclosure of directory listings. The code contains a security check to prevent path traversal for reading file contents, but this check is effectively bypassed by subsequent logic that attempts to find directory suggestions. An attacker can leverage this flaw to list the contents of arbitrary directories on the user's filesystem, including the user's home directory, exposing sensitive information about the file system's structure. This issue is fixed in version 0.13.20.

Weakness: CWE-548

Which versions are affected by CVE-2025-61685?

2 open source packages ship an affected version, including @mastra/mcp-docs-server.

PackageAffectedFixed in
@mastra/mcp-docs-server npmAll versions0.17.0
@mastra/mcp-docs-server npmAll versions0.17.0

How do I fix CVE-2025-61685?

Upgrade @mastra/mcp-docs-server to 0.17.0 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2025-61685 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-61685 exists.

Sources

Also known as GHSA-xh92-rqrq-227v.

Is CVE-2025-61685 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free