CVE-2025-58162
📋 TL;DR
CVE-2025-58162 is an arbitrary file write vulnerability in MobSF version 4.4.0. Authenticated users can upload specially crafted files to write arbitrary content to any directory writable by the MobSF process. This affects organizations using MobSF 4.4.0 for mobile application security testing.
💻 Affected Systems
- Mobile Security Framework (MobSF)
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Complete system compromise through remote code execution if attacker writes malicious files to executable locations or configuration files.
Likely Case
Data corruption, denial of service, or privilege escalation by overwriting critical files.
If Mitigated
Limited impact if file permissions restrict writable directories to non-critical areas.
🎯 Exploit Status
Requires authenticated access and knowledge of the target directory structure.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 4.4.1
Vendor Advisory: https://github.com/MobSF/Mobile-Security-Framework-MobSF/security/advisories/GHSA-9gh8-9r95-3fc3
Restart Required: No
Instructions:
1. Backup current MobSF configuration and data. 2. Update to version 4.4.1 using: pip install --upgrade mobsf. 3. Verify the update completed successfully.
🔧 Temporary Workarounds
Restrict file upload permissions
allLimit which directories the MobSF process can write to using file system permissions.
chmod -R 755 /path/to/mobsf/writable/dirs
chown -R mobsf:restricted_group /path/to/mobsf/writable/dirs
Disable file upload functionality
allTemporarily disable file uploads in MobSF if not required.
Modify MobSF configuration to disable upload endpoints
🧯 If You Can't Patch
- Implement strict access controls to limit which users can authenticate to MobSF.
- Monitor file system changes in MobSF writable directories for unauthorized modifications.
🔍 How to Verify
Check if Vulnerable:
Check MobSF version: mobsf --version or examine package metadata.
Check Version:
mobsf --version
Verify Fix Applied:
Confirm version is 4.4.1 or later and test file upload functionality with safe test files.
📡 Detection & Monitoring
Log Indicators:
- Unusual file write operations in MobSF logs
- Multiple failed upload attempts followed by successful writes
Network Indicators:
- Unusual upload patterns to MobSF endpoints
SIEM Query:
source="mobsf.log" AND ("file write" OR "upload" AND "success")