Security Rules
Complete reference of all 85+ security rules across 14 categories that rnsec checks for.
Overview: 85+ Rules Across 14 Categories
AsyncStorage, hardcoded secrets, PII, Realm, SQLite, SecureStore
HTTP usage, SSL/TLS, timeouts, WebSocket, hardcoded IPs
WebView security configurations
JWT, tokens, passwords, biometric, session timeout
Weak algorithms, hardcoded keys, custom crypto
Sensitive data in logs and errors
Bridge security, deep links, OTA updates, auth sessions
API keys (27+ patterns)
Test credentials, debug endpoints
Manifest, Keystore, permissions, WebView debug, task hijacking
Info.plist, ATS, Keychain, pasteboard, snapshots
Dangerous permissions, Expo updates, sensitive config
App configuration issues
Third-party SDK risks
Storage Security 8 rules
AsyncStorage Sensitive Data
HIGHASYNCSTORAGE_SENSITIVE_KEYDetects sensitive data stored in AsyncStorage (tokens, passwords, credentials). AsyncStorage stores data in plaintext and is accessible to all apps with root access.
Hardcoded Secrets
HIGHHARDCODED_SECRETSIdentifies hardcoded API keys, JWT tokens, AWS credentials, and secrets in source code. These can be extracted from app bundles.
PII in AsyncStorage
HIGHASYNCSTORAGE_PII_DATAAsyncStorage storing PII (email, phone, SSN, credit card) without encryption. Required for GDPR/CCPA compliance.
Unencrypted Redux Persist
MEDIUMREDUX_PERSIST_NO_ENCRYPTIONRedux persist configuration without encryption transform for sensitive data.
Clipboard Sensitive Data
MEDIUMCLIPBOARD_SENSITIVE_DATASensitive data copied to clipboard (accessible by other apps).
Unencrypted Realm Database
HIGHUNENCRYPTED_REALM_DATABASERealm database opened without encryptionKey in contexts handling sensitive data. Unencrypted Realm databases can be extracted from rooted/jailbroken devices.
Unencrypted SQLite Database
HIGHUNENCRYPTED_SQLITE_DATABASESQLite databases used without encryption (SQLCipher) for sensitive data storage. Plain SQLite databases can be extracted and read on compromised devices.
Expo SecureStore Weak Options
MEDIUMEXPO_SECURE_STORE_WEAK_OPTIONSExpo SecureStore configured with weak keychain accessibility options (AFTER_FIRST_UNLOCK or ALWAYS) for sensitive keys. These options make data accessible even when the device is locked.
Network Security 5 rules
HTTP URL in WebView
MEDIUMINSECURE_HTTP_URLWebView loading HTTP URLs instead of HTTPS.
No Request Timeout
MEDIUMNO_REQUEST_TIMEOUTNetwork requests without timeout configuration. Can lead to resource exhaustion and denial of service if requests hang indefinitely.
Weak TLS Configuration
MEDIUMWEAK_TLS_CONFIGURATIONTLS version less than 1.2 or custom httpsAgent with insecure options. Weak TLS configurations are vulnerable to protocol downgrade attacks.
Insecure WebSocket
MEDIUMINSECURE_WEBSOCKETWebSocket connections using unencrypted ws:// protocol. Data transmitted over ws:// can be intercepted via MITM attacks.
Hardcoded IP Address
MEDIUMHARDCODED_IP_ADDRESSHardcoded IP addresses in network URLs and API configurations. Hardcoded IPs make infrastructure changes difficult and may expose internal network topology.
WebView Security 11 rules
Insecure WebView Configuration
HIGHINSECURE_WEBVIEWWebView with dangerous default configurations that can enable XSS and code injection.
JavaScript Injection Risk
HIGHWEBVIEW_JAVASCRIPT_INJECTIONWebView with JavaScript enabled loading dynamic or user-controlled content.
File Access Enabled
HIGHWEBVIEW_FILE_ACCESSWebView with file access enabled - allows access to local files.
Unvalidated Navigation
HIGHWEBVIEW_UNVALIDATED_NAVIGATIONWebView without URL validation on navigation - potential open redirect.
PostMessage No Origin Check
HIGHWEBVIEW_POSTMESSAGE_NO_ORIGIN_CHECKWebView onMessage handler without origin validation.
DOM Storage Enabled
MEDIUMWEBVIEW_DOM_STORAGE_ENABLEDWebView with DOM storage enabled - may expose sensitive data.
Geolocation Enabled
MEDIUMWEBVIEW_GEOLOCATION_ENABLEDWebView with geolocation enabled - requires proper permission handling.
Mixed Content Allowed
MEDIUMWEBVIEW_MIXED_CONTENTWebView allows mixed content - HTTPS pages can load HTTP resources.
Caching Enabled
LOWWEBVIEW_CACHING_ENABLEDWebView with caching enabled - may cache sensitive content.
JavaScript Bridge Without Validation
HIGHJAVASCRIPT_ENABLED_BRIDGENative module calls without input validation.
Missing Security Headers
LOWMISSING_SECURITY_HEADERSWebView loading content without proper security headers like Content-Security-Policy (CSP) or X-Frame-Options. Missing headers can enable XSS and clickjacking attacks.
Authentication & Authorization 8 rules
Insecure Random
HIGHINSECURE_RANDOMMath.random() used for security-sensitive operations (tokens, session IDs, encryption keys, OTP codes). Only flagged when used in security contexts - general use like Math.random() * 100 is ignored.
OAuth Token in URL
HIGHOAUTH_TOKEN_IN_URLOAuth/access token passed in URL query parameters - logged in browser history.
Certificate Pinning Disabled
MEDIUMCERT_PINNING_DISABLEDSSL certificate pinning not implemented. While this is a recommended hardening measure against MITM attacks, many legitimate apps operate securely without it. Consider implementing for high-security applications.
No JWT Expiry Check
MEDIUMJWT_NO_EXPIRY_CHECKJWT token retrieved from storage without expiration validation.
Insecure Password Input
MEDIUMTEXT_INPUT_NO_SECUREPassword or sensitive input field without secureTextEntry property.
Improper Biometric Fallback
MEDIUMIMPROPER_BIOMETRIC_FALLBACKBiometric authentication falling back to insecure methods like PIN stored in JavaScript or plaintext password. Fallback mechanisms should be as secure as the primary authentication method.
Root/Jailbreak Detection Absent
HIGHROOT_JAILBREAK_DETECTION_ABSENTNo root/jailbreak detection for sensitive apps (banking, fintech, healthcare). Rooted/jailbroken devices can bypass security controls and expose sensitive data.
Missing Session Timeout
MEDIUMMISSING_SESSION_TIMEOUTAuthentication/session management files without session timeout or inactivity expiry logic. Without timeouts, stolen tokens remain valid indefinitely.
Cryptography 3 rules
Weak Cryptographic Algorithm
HIGHWEAK_CRYPTO_ALGORITHMUse of weak crypto algorithms like MD5, SHA1, DES, or RC4.
Hardcoded Encryption Key
HIGHHARDCODED_ENCRYPTION_KEYEncryption keys hardcoded in source code.
Custom Crypto Implementation
HIGHCUSTOM_CRYPTO_IMPLEMENTATIONCustom/DIY cryptographic implementations instead of standard libraries. Rolling your own crypto is a well-known anti-pattern that leads to exploitable vulnerabilities.
Logging 2 rules
Network Logger in Production
MEDIUMNETWORK_LOGGER_IN_PRODUCTIONNetwork request/response logging enabled (Axios interceptors, fetch logging). Logs may contain auth tokens, API keys, and sensitive request data.
Sensitive Data in Error Messages
MEDIUMSENSITIVE_DATA_IN_ERROR_MESSAGESBackend error responses surfaced directly to UI or stack traces shown in production. Error messages can expose internal system details, credentials, or sensitive data paths.
React Native / Expo 13 rules
Debugger Enabled in Production
MEDIUMDEBUGGER_ENABLED_PRODUCTIONDebugger statements or __DEV__ checks in production code. Debug code exposes internal state and can bypass security checks.
Insecure Deeplink Handler
HIGHINSECURE_DEEPLINK_HANDLERDeep link handlers without proper URL validation. Malicious apps can trigger arbitrary deep links to execute unauthorized actions.
Screenshot Protection Missing
MEDIUMSCREENSHOT_PROTECTION_MISSINGSensitive screens without screenshot/screen recording protection. Screenshots can expose sensitive data in photo galleries and backups.
Unsafe dangerouslySetInnerHTML
HIGHUNSAFE_DANGEROUSLY_SET_INNER_HTMLdangerouslySetInnerHTML used with potentially unsafe content. Enables XSS attacks if user input is rendered as HTML.
Eval Usage
HIGHEVAL_USAGEeval() or Function constructor used - code injection risk. Allows arbitrary code execution.
Console Log Sensitive Data
LOWCONSOLE_LOG_SENSITIVEconsole.log() statements logging sensitive data.
Navigation State Contains Sensitive Data
MEDIUMNAVIGATION_STATE_SENSITIVESensitive data passed in navigation params or state.
Missing Runtime Integrity Checks
HIGHMISSING_RUNTIME_INTEGRITY_CHECKSNo tamper detection, checksum/signature verification, or integrity APIs (Play Integrity API, App Attest). Apps without integrity checks are vulnerable to modification and reverse engineering.
Expo Updates No Code Signing
HIGHEXPO_UPDATES_NO_CODE_SIGNINGExpo OTA updates configured without code signing verification. Without code signing, OTA updates can be tampered with via MITM attacks, allowing attackers to inject malicious code.
Insecure Linking.openURL
HIGHINSECURE_LINKING_OPENLinking.openURL() called with dynamic/variable URLs without validation. Can be exploited to open malicious URL schemes (tel:, sms:, custom deep links).
Sensitive Navigation Params
MEDIUMSENSITIVE_NAVIGATION_PARAMSSensitive data (passwords, tokens, API keys) passed through React Navigation navigate() or push() params. Navigation params are serialized and may persist in navigation state.
Push Notification Sensitive Data
MEDIUMPUSH_NOTIFICATION_SENSITIVE_DATAPush notification handlers that log or insecurely store notification payload data containing sensitive information.
Expo AuthSession No PKCE
HIGHEXPO_AUTH_SESSION_NO_PKCEExpo AuthSession OAuth flows with PKCE explicitly disabled (usePKCE: false). Without PKCE, mobile OAuth flows are vulnerable to authorization code interception attacks.
API Keys & Secrets Detection 2 rules
API Key Exposed
HIGHAPI_KEY_EXPOSEDDetects 27+ types of exposed API keys and secrets including Firebase, AWS, Stripe, GitHub tokens, RSA keys, JWT tokens, and more. Exposed API keys lead to unauthorized access, data breaches, and financial loss.
Environment File Committed
HIGHENV_FILE_COMMITTEDEnvironment file (.env) with secrets potentially committed to repository. .env files contain production secrets and should never be in version control.
Debug & Development Artifacts 5 rules
Test Credentials in Code
MEDIUMTEST_CREDENTIALS_IN_CODETest credentials or example passwords found in source code (test@test.com, admin/admin, demo passwords). Test credentials often work in production or reveal credential format.
Debug Endpoints Exposed
MEDIUMDEBUG_ENDPOINTS_EXPOSEDDebug or development endpoints exposed in production code (/debug, /dev, /test, /admin). Debug endpoints bypass authentication and expose internal functionality.
Redux DevTools Enabled
MEDIUMREDUX_DEVTOOLS_ENABLEDRedux DevTools enabled in production. Exposes entire application state including sensitive data.
Storybook in Production
LOWSTORYBOOK_IN_PRODUCTIONStorybook imports detected in production code. Increases bundle size and may expose component internals.
Source Map Reference
LOWSOURCEMAP_REFERENCESource map reference in production bundle. Source maps reveal original source code including comments and logic.
Android Security 12 rules
Cleartext Traffic Enabled
HIGHANDROID_CLEARTEXT_ENABLEDandroid:usesCleartextTraffic="true" in AndroidManifest.xml - allows unencrypted HTTP.
Debuggable in Production
HIGHANDROID_DEBUGGABLE_ENABLEDandroid:debuggable="true" in production manifest - allows debuggers to attach.
Exported Component Unprotected
HIGHANDROID_EXPORTED_COMPONENTExported Android component without permission protection - other apps can access.
Unprotected Receiver
HIGHANDROID_UNPROTECTED_RECEIVERBroadcast receiver without permission protection - any app can send broadcasts.
Backup Allowed
MEDIUMANDROID_BACKUP_ALLOWEDandroid:allowBackup="true" - app data included in cloud backups.
Permissive Intent Filter
MEDIUMANDROID_INTENT_FILTER_PERMISSIVEOverly permissive intent filter may expose unintended functionality.
Insecure Android Keystore Usage
HIGHINSECURE_KEYSTORE_USAGEAndroid Keystore configuration without StrongBox, user authentication, or using weak block modes like ECB. Insecure Keystore usage weakens encryption and key protection.
Insecure File Storage
MEDIUMINSECURE_FILE_STORAGEFiles written to external storage, shared directories, or without encryption. Externally stored files are accessible to other apps and users.
Excessive Permissions
LOWEXCESSIVE_PERMISSIONSAndroid permissions declared but not used in code. Unnecessary permissions raise privacy concerns and user distrust.
Task Affinity Vulnerability
MEDIUMANDROID_TASK_AFFINITY_VULNERABILITYAndroid activities with custom taskAffinity attribute, which enables StrandHogg task hijacking attacks. A malicious app can set the same task affinity to intercept the activity.
WebView Debug Enabled
HIGHANDROID_WEBVIEW_DEBUG_ENABLEDWebView remote debugging left enabled without a build-type guard. Allows attackers with physical access to inspect and modify WebView content via Chrome DevTools.
Missing Network Security Config
MEDIUMANDROID_MISSING_NETWORK_SECURITY_CONFIGAndroid manifest without network_security_config.xml reference for apps using internet permission. Without this config, the app cannot enforce certificate pinning or restrict cleartext traffic per-domain.
iOS Security 10 rules
ATS Disabled
HIGHIOS_ATS_DISABLEDApp Transport Security disabled via NSAllowsArbitraryLoads - allows insecure HTTP.
Permissive ATS Exception
HIGHIOS_ATS_EXCEPTION_TOO_PERMISSIVEATS exception allows insecure loads for entire domains unnecessarily.
Missing Usage Descriptions
MEDIUMIOS_USAGE_DESCRIPTIONS_MISSINGMissing usage descriptions for privacy-sensitive permissions (Camera, Location, etc).
Unnecessary Background Modes
MEDIUMIOS_BACKGROUND_MODES_UNNECESSARYPotentially unnecessary background modes enabled - privacy concerns.
Universal Links Misconfigured
MEDIUMIOS_UNIVERSAL_LINKS_MISCONFIGUREDUniversal links configured without proper validation.
Unprotected URL Scheme
MEDIUMIOS_CUSTOM_URL_SCHEME_UNPROTECTEDCustom URL scheme without validation code - any app can open.
Insecure Keychain Access
MEDIUMIOS_KEYCHAIN_ACCESS_GROUP_INSECUREKeychain access group configuration may expose data to other apps.
Insecure iOS Keychain Usage
HIGHINSECURE_KEYCHAIN_USAGEKeychain items using kSecAttrAccessibleAlways, missing kSecAttrAccessControl, or no biometric/passcode protection. Always-accessible keychain items can be extracted without user authentication.
Insecure Pasteboard Usage
MEDIUMIOS_INSECURE_PASTEBOARD_USAGESensitive data written to the iOS pasteboard (clipboard), which is shared across all apps. On iOS versions before 14, any app can silently read the pasteboard.
Missing App Snapshot Protection
LOWIOS_MISSING_APP_SNAPSHOT_PROTECTIONSensitive apps without protection against iOS app snapshots. iOS captures a screenshot when the app enters the background for the app switcher, potentially exposing sensitive data.
Configuration 4 rules
Expo Insecure Permissions
LOWEXPO_INSECURE_PERMISSIONSPotentially dangerous permissions in app.json. Overreaching permissions raise privacy concerns.
Insecure Deserialization
LOWINSECURE_DESERIALIZATIONJSON.parse on untrusted input, eval-like dynamic object construction, or native deserialization without validation. Can lead to code execution or prototype pollution attacks.
Expo Updates Insecure URL
LOWEXPO_UPDATES_INSECURE_URLExpo updates URL configured over insecure HTTP in app.json. HTTP update URLs allow MITM attackers to inject malicious code via OTA updates.
Expo Sensitive Config Exposed
LOWEXPO_SENSITIVE_CONFIG_EXPOSEDSensitive values (API keys, secrets, passwords) hardcoded in app.json configuration. These values are bundled into the app binary and can be extracted.
Manifest 2 rules
Excessive Manifest Permissions
LOWMANIFEST_PERMISSIONS_EXCESSIVEApp requests more permissions than necessary. Privacy concern, users may decline installation.
Third-Party SDK Risk
LOWTHIRD_PARTY_SDK_RISKKnown risky SDKs detected such as session replay tools or ad SDKs in sensitive apps. Some SDKs collect excessive data or introduce security vulnerabilities.
View All Rules via CLI
List all 85+ available security rules with the command:
rnsec rules