CVE-2025-58161
Unknown Unknown - Not Provided
BaseFortify

Publication date: 2025-09-02

Last updated on: 2025-09-03

Assigner: GitHub, Inc.

Description
MobSF is a mobile application security testing tool used. In version 4.4.0, the GET /download/ route uses string path verification via os.path.commonprefix, which allows an authenticated user to download files outside the DWD_DIR download directory from "neighboring" directories whose absolute paths begin with the same prefix as DWD_DIR (e.g., .../downloads_bak, .../downloads.old). This is a Directory Traversal (escape) leading to a data leak. This issue has been patched in version 4.4.1.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2025-09-02
Last Modified
2025-09-03
Generated
2026-05-27
AI Q&A
2025-09-02
EPSS Evaluated
2026-05-25
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
opensecurity mobile_security_framework 4.4.0
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-22 The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

CVE-2025-58161 is a path traversal vulnerability in MobSF version 4.4.0 affecting the GET /download/<filename> endpoint. The application uses a flawed path verification method based on os.path.commonprefix, which compares string prefixes rather than actual directory boundaries. This allows an authenticated user to download files outside the intended download directory (DWD_DIR) from sibling directories whose absolute paths share the same initial string prefix as DWD_DIR (e.g., downloads_bak or downloads.old). The vulnerability arises because absolute paths or crafted filenames bypass the directory restriction, enabling unauthorized file access. This issue was fixed in version 4.4.1. [3]


How can this vulnerability impact me? :

This vulnerability allows any authenticated user to download files from directories outside the designated download directory if those directories have paths with the same prefix as the download directory. This leads to unauthorized disclosure of files that should not be accessible, potentially exposing sensitive or private data. The impact is a data leak due to directory traversal, but the severity is rated low with no direct impact on confidentiality, integrity, or availability beyond unauthorized file access. [3]


How can this vulnerability be detected on my network or system? Can you suggest some commands?

Detection of this vulnerability involves monitoring for unauthorized file download attempts using path traversal patterns in the GET /download/ endpoint. Specifically, look for HTTP requests with filenames containing absolute paths, '../', or URL-encoded traversal sequences targeting sibling directories of the download directory. Since the vulnerability requires authentication, review authenticated GET requests to /download/ with suspicious path parameters. There are no specific commands provided in the resources, but you can use network monitoring tools or web server logs to filter requests matching these patterns, for example using grep or similar tools on access logs: grep -E 'GET /download/.*(\.\.|%2e%2e|%252e%252e|/|\\)' access.log. Additionally, verify the MobSF version; versions prior to 4.4.1 are vulnerable. [3]


What immediate steps should I take to mitigate this vulnerability?

The immediate mitigation step is to upgrade MobSF to version 4.4.1 or later, where the vulnerability has been patched by improving path validation and restricting file downloads to the intended directory. If upgrading is not immediately possible, restrict access to the GET /download/ endpoint to trusted users only, and monitor for suspicious download requests. Additionally, review and harden any custom path validation logic to prevent absolute paths and path traversal sequences. Applying the official patch or update is the recommended and most effective mitigation. [2, 3]


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart