oopsec
v0.1.0
Published
π¬ Your app got caught. Security auditor for React Native apps β finds secrets, leaks & vulnerabilities before hackers do.
Maintainers
Readme
"Turns out your React Native app has been walking around with its secrets exposed this whole time."
oopsec finds API keys, tokens, passwords, and security vulnerabilities in your React Native app β before hackers do. It even cracks open your APK to show you exactly what the outside world can see.
The Problem
When React Native builds your app, everything β including all your .env variables β gets bundled into a single unencrypted file inside the APK called index.android.bundle.
An APK is just a ZIP file wearing a disguise. Rename it. Unzip it. Walk right in.
oopsec does exactly that β so you can find the leaks before someone else does.
Quick Start
# Scan your project
npx oopsec
# The killer feature β scan your actual APK
npx oopsec --apk ./android/app/build/outputs/apk/release/app-release.apkWhat It Finds
π Secrets & API Keys (30+ patterns)
- Firebase, AWS, Stripe, Google, GitHub, Slack, Twilio, SendGrid, PubNub, Supabase, Sentry, Algolia
- Hardcoded passwords, JWT tokens, Bearer tokens, private keys
- Generic API key and secret assignments
π± React Native Specific Issues
AsyncStoragestoring sensitive data (tokens, passwords) unencrypted- Cleartext HTTP URLs (non-localhost)
- Unvalidated deep link handlers
console.logleaking sensitive data- WebView with JavaScript injection enabled
- Sensitive data copied to clipboard
- Unencrypted Realm/SQLite databases
- Disabled SSL pinning
ποΈ Build Configuration
android:allowBackup="true"β lets anyone extract app data via USBandroid:debuggable="true"β lets anyone attach a debugger- Cleartext traffic allowed in Android/iOS
- Missing code obfuscation (ProGuard/R8)
- Hardcoded keystore passwords
.envfiles not in.gitignore- iOS
NSAllowsArbitraryLoadsdisabling ATS
π¦ Dependencies
- Known CVEs via npm audit
- Risky packages in production (debugger tools, dotenv bundlers)
- Outdated React Native versions with known vulnerabilities
- Missing lockfiles
π£ APK Deep Scan (The Killer Feature)
- Extracts JS bundle from APK β shows what hackers actually see
- Detects source maps shipped in production (exposes entire codebase)
- Cross-references: if a secret is in your source AND in the APK bundle, it's confirmed exposed
- Scans all
.js,.json,.env,.pem,.keyfiles inside the APK
Usage
# Basic scan of current directory
npx oopsec
# Scan a specific directory
npx oopsec --dir /path/to/your/rn-project
# Scan an APK file
npx oopsec --apk ./app-release.apk
# JSON output (for CI/CD pipelines)
npx oopsec --json
# Fail CI if critical or high issues found
npx oopsec --fail-on high
# Run specific scanners only
npx oopsec --scanners source,config
# Verbose output
npx oopsec --verboseExample Output
oopsec v0.1.0
Your app got caught.
β CRITICAL Firebase API Key
src/config.js:12
Google Firebase API key β can access Firebase services
β CRITICAL Firebase API Key [CONFIRMED IN APK]
Found in APK JS bundle β 100% exposed to the world
β HIGH Sensitive Data in AsyncStorage
src/auth/login.js:45
AsyncStorage is unencrypted. Use react-native-keychain instead.
β οΈ MEDIUM Android Backup Enabled
android/app/src/main/AndroidManifest.xml
allowBackup="true" allows USB data extraction
β
PASSED Dependencies
β
PASSED Log statements
Score: 35/100
2 Critical 1 High 1 Medium
Your app has critical security issues that must be fixed before shipping.Use in CI/CD
GitHub Actions
- name: Security Audit
run: npx oopsec --fail-on high --json > security-report.jsonAs a pre-commit hook
{
"husky": {
"hooks": {
"pre-commit": "npx oopsec --fail-on critical"
}
}
}Programmatic API
const { audit } = require('oopsec');
const report = await audit({
projectDir: './my-rn-app',
apkPath: './app-release.apk',
});
console.log(`Score: ${report.score}/100`);
console.log(`Critical issues: ${report.stats.critical}`);Why oopsec?
"Oops" + "OpSec" (Operational Security).
Because shipping your API keys to the world was probably an oops. π¬
Every mobile app is a published book β once it's out there, anyone can open it and read every page. oopsec makes sure there's nothing worth reading.
Contributing
See CONTRIBUTING.md for details on adding new scanners and patterns.
License
MIT
