Mobile Security Framework (MobSF) has a Zip Slip Vulnerability in .a Static Library Files
Summary
Upon reviewing the MobSF source code, I identified a flaw in the Static Libraries analysis section. Specifically, during the extraction of .a extension files, the measure intended to prevent Zip Slip attacks is improperly implemented.
Since the implemented measure can be bypassed, the vulnerability allows an attacker to extract files to any desired location within the server running MobSF.
Details
Upon examining lines 183-192 of the mobsf/StaticAnalyzer/views/common/shared_func.py file, it is observed that there is a mitigation against Zip Slip attacks implemented as a.decode('utf-8', 'ignore').replace('../', '').replace('..\\', ''). However, this measure can be bypassed using sequences like ....//....//....//. Since the replace operation is not recursive, this sequence is transformed into ../../../ after the replace operation, allowing files to be written to upper directories.
For the proof of concept, I created an .a archive file that renders MobSF unusable by writing an empty file with the same name over the database located at /home/mobsf/.MobSF/db.sqlite3.
I am including the binary used for the POC named poc.VULN. To test it, you need to rename this binary to poc.a.
Warning: As soon as you scan this file with MobSF, the database will be deleted, rendering MobSF unusable.
PoC Binary File (poc.VULN)
PoC
https://github.com/user-attachments/assets/3225ccb0-cb00-47a5-8305-37a40ca1ae7f
Impact
When a malicious .a file is scanned with MobSF, a critical vulnerability is present as it allows files to be extracted to any location on the server where MobSF is running. In this POC, I deleted the database, but it is also possible to achieve RCE by overwriting binaries of certain tools or by overwriting the /etc/passwd file.
Betroffene Software
Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.
| Plattform | Paket | Anfällige Versionen | Behoben in |
|---|---|---|---|
| Python (PyPI) | mobsf | < 4.0.7 | 4.0.7 |
Verweise
- https://github.com/MobSF/Mobile-Security-Framework-MobSF/security/advisories/GHSA-4hh3-vj32-gr6j
- https://nvd.nist.gov/vuln/detail/CVE-2024-43399
- https://github.com/MobSF/Mobile-Security-Framework-MobSF/commit/cc625fe8430f3437a473e82aa2966d100a4dc883
- https://github.com/MobSF/Mobile-Security-Framework-MobSF
- https://pypi.org/project/mobsf
- https://github.com/advisories/GHSA-4hh3-vj32-gr6j
- CVSS-Vektor
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H- Schwäche (CWE)
CWE-22, CWE-23- Plattform
- Python (PyPI)
- Paket
mobsf- Veröffentlicht
- 19.08.2024
- Aktualisiert
- 11.10.2026 13:19
Quellen und Lizenzen
OSV / GitHub Advisory Database - PYSEC-2026-1665 - PyPA Advisory Database; CC BY 4.0
OSV / GitHub Advisory Database - GHSA-4hh3-vj32-gr6j - CC BY 4.0
Schwachstellenhistorie: mobsf
Alle veröffentlichten Schwachstellen dieses Pakets (Python (PyPI)), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.
- Einträge insgesamt
- 22
- Erste → letzte
- 10.2022 08.2026
- Ohne Fix
- 1
- In Angriffen ausgenutzt
- 0
Verteilung nach Schweregrad
- Hoch 9
- Mittel 11
- Niedrig 2
Veröffentlichungen pro Jahr
- 2022: 1
- 2023: 1
- 2024: 6
- 2025: 8
- 2026: 6
-
Mobile Security Framework (MobSF) has a Zip Slip Vulnerability in .a Static Library Files dieser Eintrag
Erkennen Sie Schwachstellen in Ihrer Anwendung
Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.