CVE-2024-53999
📋 TL;DR
MobSF versions before 4.2.9 have a stored XSS vulnerability in the 'Diff or Compare' functionality. Attackers can upload malicious script files that execute when users access the comparison feature, potentially compromising user sessions or stealing credentials. This affects all MobSF users who haven't updated to version 4.2.9.
💻 Affected Systems
- Mobile Security Framework (MobSF)
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Attackers could steal administrator credentials, hijack user sessions, perform actions as authenticated users, or deploy malware to client browsers.
Likely Case
Session hijacking, credential theft, or unauthorized actions performed in the context of authenticated users.
If Mitigated
Limited to same-origin policy restrictions; attackers could still perform actions within the MobSF application context.
🎯 Exploit Status
Requires file upload capability and user interaction with vulnerable feature; stored XSS persists until cleanup.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 4.2.9
Vendor Advisory: https://github.com/MobSF/Mobile-Security-Framework-MobSF/security/advisories/GHSA-5jc6-h9w7-jm3p
Restart Required: No
Instructions:
1. Backup current MobSF installation and data. 2. Update to version 4.2.9 using: git pull origin master. 3. Run: python3 manage.py migrate. 4. Restart MobSF services if running as daemon.
🔧 Temporary Workarounds
Disable file upload functionality
allTemporarily disable file uploads in MobSF configuration to prevent malicious file injection.
Edit MobSF settings to restrict upload permissions or disable upload endpoints
Disable 'Diff or Compare' feature
allRemove or disable the vulnerable comparison functionality in the UI.
Modify MobSF frontend to hide/disable comparison buttons and endpoints
🧯 If You Can't Patch
- Implement strict Content Security Policy (CSP) headers to restrict script execution
- Deploy web application firewall (WAF) rules to detect and block XSS payloads in file uploads
🔍 How to Verify
Check if Vulnerable:
Check MobSF version; if below 4.2.9, system is vulnerable. Review file upload logs for suspicious script filenames.
Check Version:
python3 manage.py --version or check MobSF web interface footer
Verify Fix Applied:
Confirm version is 4.2.9 or higher. Test file upload with script in filename and verify it's properly sanitized.
📡 Detection & Monitoring
Log Indicators:
- File uploads with script extensions (.js, .html) in filename
- Multiple failed upload attempts with suspicious filenames
- Unusual user activity after using comparison feature
Network Indicators:
- POST requests to upload endpoints with script content in filenames
- Subsequent requests to comparison endpoints with injected payloads
SIEM Query:
source="mobsf" AND (filename="*.js" OR filename="*.html" OR filename CONTAINS "<script")