A Python tool to scan React Native APKs for vulnerable npm dependencies by analyzing modules.json
.
It extracts the list of JavaScript packages used in the app and checks for known vulnerabilities using Snyk's vulnerability database.
Before running this script, decompile the APK using apktool
to locate modules.json
.
apktool d myapp.apk -o myapp_decompiled
Locate modules.json
myapp_decompiled/
βββ base/
β βββ assets/
β β βββ modules.json # β This is the file you need!
Once found, you can use this script to check for vulnerabilities.
- β Scans npm dependencies in React Native APKs π
- β Multi-threaded scanning for faster results β‘
- β Loading animation while scanning π
- β Colored terminal output for better visibility π¨
- β Optional file output (-o) to save vulnerabilities π
- β Auto-detects missing JSON file and provides help messages β
- β Prints "No vulnerabilities found! π" if none are detected β
git clone https://github.com/BhattJayD/react-native-vulnerability-scanner.git
cd react-native-vulnerability-scanner
python3 -m venv venv
source venv/bin/activate # On Windows use: venv\Scripts\activate
pip install -r requirements.txt
python RNScanner py
usage: RNScanner.py [-h] [-f FILE] [-o]
Check vulnerabilities in npm packages.
options:
-h, --help show this help message and exit
-f FILE, --file FILE Path to module.json file (default: modules.json)
-o, --output Save results to a file (default: False)
python app.py -f myapp_decompiled/base/assets/modules.json
python app.py -f myapp_decompiled/base/assets/modules.json -o
python3 app.py -f modules.json -o
Checking vulnerabilities [\]
react-native : 0.76.7
promise : 8.3.0
Results saved to vulnerable_packages.txt
Done!
No vulnerabilities found! π
β
Done!
(β‘ No empty file is saved.)
π Contributions are welcome! Feel free to fork the repository, create a branch, make improvements, and submit a pull request.
- Fork the Repository
- Clone Your Fork
- Create a New Branch
- Make Your Changes & Commit
- Push to Your Fork
- Submit a Pull Request (PR)
This project is licensed under the MIT License. You are free to use, modify, and distribute it with proper attribution.
Jay Bhatt
- GitHub: BhattJayD
- Twitter: @ogSplitUnknown
- Youtube: https://www.youtube.com/@SplitUnknown
- Medium: https://splitunknown.medium.com
If you like this project, consider starring π the repository! For suggestions, issues, or feature requests, open an issue in this repo.