GHSA-4hh3-vj32-gr6j
HIGHGHSA-4hh3-vj32-gr6j is a high-severity (CVSS 8) CWE-23 vulnerability in mobsf. 1 public exploit reference exists, so weaponization risk is real. O3 Security confirms whether GHSA-4hh3-vj32-gr6j is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
Mobile Security Framework (MobSF) has a Zip Slip Vulnerability in .a Static Library Files
Blast Radius
mobsfReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | mobsf | all versions | 4.0.7 |
Research use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for mobsf. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update mobsf to 4.0.7 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-4hh3-vj32-gr6j is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-4hh3-vj32-gr6j is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-4hh3-vj32-gr6j. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-4hh3-vj32-gr6j in your dependencies?
O3 detects GHSA-4hh3-vj32-gr6j across PyPI dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.