Skip to main content

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

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/04/2025, 00:10:25 UTC

Technical Analysis

CVE-2025-61685 is a medium-severity vulnerability affecting the mastra-ai mastra framework, specifically versions 0.13.8 through 0.13.20-alpha.0. Mastra is a Typescript framework designed for building AI agents and assistants. The vulnerability arises from an improper implementation of directory traversal protection. Although the code includes a security check intended to prevent path traversal when reading file contents, this check is bypassed by subsequent logic that attempts to provide directory suggestions. This flaw allows an attacker to perform a directory listing attack, enabling them to enumerate the contents of arbitrary directories on the user's 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 further attacks such as targeted exploitation or social engineering. Notably, the vulnerability does not allow modification or deletion of files, nor does it require user interaction, but it does require some level of privileges (PR:L) on the system to exploit remotely (AV:N). The vulnerability has a CVSS v3.1 base score of 6.5, reflecting a medium severity level, with a high impact on confidentiality but no impact on integrity or availability. The issue is resolved in version 0.13.20 of the mastra framework. There are no known exploits in the wild at this time, but the vulnerability is publicly disclosed and should be addressed promptly to prevent potential information leakage.

Potential Impact

For European organizations using the mastra-ai mastra framework in affected versions, this vulnerability poses a significant risk to confidentiality. Exposure of directory listings can reveal sensitive file system structures, configuration files, user data, or other information that could facilitate further attacks such as privilege escalation, lateral movement, or targeted phishing campaigns. Organizations in sectors with high data sensitivity, such as finance, healthcare, and government, could face increased risk if attackers leverage this vulnerability to gain insights into internal systems. Since the vulnerability requires some level of privileges, it is particularly concerning in environments where multiple users or services operate with elevated permissions. The lack of impact on integrity and availability reduces the risk of direct system disruption, but the information disclosure alone can have serious consequences for compliance with data protection regulations like GDPR, potentially leading to legal and reputational damage. Additionally, AI-driven applications built on mastra may be part of critical business workflows, so information leakage could indirectly affect operational security.

Mitigation Recommendations

European organizations should immediately upgrade all instances of the mastra framework to version 0.13.20 or later, where the vulnerability is fixed. Until the upgrade can be performed, organizations should restrict access to systems running vulnerable versions by implementing strict network segmentation and access controls to limit exposure to trusted users only. Conduct thorough audits of user privileges to ensure that only necessary accounts have the level of access required to exploit this vulnerability. Employ runtime application self-protection (RASP) or web application firewalls (WAFs) with custom rules to detect and block suspicious directory traversal attempts targeting mastra-based applications. Additionally, monitor logs for unusual directory listing requests or access patterns that could indicate exploitation attempts. Educate developers and system administrators about secure coding practices related to path traversal and directory access to prevent similar issues in future deployments. Finally, perform regular vulnerability scans and penetration tests focusing on directory traversal and information disclosure vectors in AI frameworks and related components.

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/4/2025, 12:10:25 AM

Last updated: 10/4/2025, 1:08:41 AM

Views: 3

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

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