Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2025-61685: CWE-548: Exposure of Information Through Directory Listing in mastra-ai mastra

0
Medium
VulnerabilityCVE-2025-61685cvecve-2025-61685cwe-548
Published: Fri Oct 03 2025 (10/03/2025, 22:37:09 UTC)
Source: CVE Database V5
Vendor/Project: mastra-ai
Product: mastra

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.

AI-Powered Analysis

AILast updated: 10/11/2025, 00:16:51 UTC

Technical Analysis

Mastra is a Typescript framework designed for building AI agents and assistants. Versions from 0.13.8 through 0.13.20-alpha.0 contain a vulnerability identified as CVE-2025-61685, categorized under CWE-548 (Exposure of Information Through Directory Listing). The vulnerability stems from a flawed implementation of directory traversal protection. Although the code includes a security check intended to prevent path traversal when reading file contents, this check is circumvented by subsequent logic that attempts to provide directory suggestions. This bypass allows an attacker with at least limited privileges (PR:L) to exploit the flaw remotely (AV:N) without user interaction (UI:N) to list arbitrary directories on the filesystem, including sensitive locations such as the user's home directory. The exposure of directory listings can reveal critical information about the file system structure, potentially aiding attackers in planning further attacks or identifying sensitive files. The vulnerability does not allow modification or deletion of files (Integrity: None, Availability: None), but the confidentiality impact is high due to information disclosure. The CVSS 3.1 base score is 6.5, reflecting a medium severity level. No known exploits are currently reported in the wild. The issue is resolved in mastra version 0.13.20, and users are advised to upgrade to this or later versions to mitigate the risk.

Potential Impact

For European organizations, the primary impact of CVE-2025-61685 is the unauthorized disclosure of directory structures and potentially sensitive file information on systems running vulnerable versions of the mastra framework. This exposure can facilitate reconnaissance activities by attackers, enabling them to identify critical files, configuration data, or user information that could be leveraged in subsequent attacks such as privilege escalation, data exfiltration, or targeted malware deployment. Organizations involved in AI development or deploying AI assistants using mastra are at risk of having their internal file system layouts exposed, which could compromise intellectual property or user privacy. Although the vulnerability does not directly allow data modification or service disruption, the confidentiality breach can undermine trust and compliance with data protection regulations such as GDPR. The risk is heightened in environments where mastra is deployed on shared or multi-tenant systems, or where access controls are insufficient. Additionally, attackers exploiting this vulnerability remotely with low privileges and no user interaction increases the threat surface for European enterprises relying on this framework.

Mitigation Recommendations

To mitigate CVE-2025-61685, European organizations should take the following specific actions: 1) Immediately upgrade all instances of the mastra framework to version 0.13.20 or later, where the vulnerability is fixed. 2) Conduct an inventory of all systems running vulnerable mastra versions to ensure comprehensive patching. 3) Restrict network access to services running mastra to trusted internal networks or VPNs to reduce exposure to remote attackers. 4) Implement strict access controls and least privilege principles for users and services interacting with mastra to limit the ability of attackers to exploit the vulnerability. 5) Monitor logs and network traffic for unusual directory listing requests or patterns indicative of reconnaissance attempts. 6) If upgrading is not immediately feasible, consider deploying web application firewalls (WAFs) or intrusion detection systems (IDS) with custom rules to detect and block directory traversal attempts targeting mastra endpoints. 7) Educate developers and system administrators about secure coding practices to avoid similar logic bypasses in path validation. 8) Regularly review and audit filesystem permissions to minimize sensitive data exposure even if directory listings occur.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2025-09-29T20:25:16.182Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 68e065e211971642e8580b76

Added to database: 10/4/2025, 12:10:10 AM

Last enriched: 10/11/2025, 12:16:51 AM

Last updated: 11/16/2025, 8:31:45 AM

Views: 65

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats