Security Rules
Complete reference of all 68+ security rules across 13 categories that rnsec checks for.
Overview: 68+ Rules Across 13 Categories
AsyncStorage, hardcoded secrets, PII
HTTP usage, SSL/TLS, timeouts
WebView security configurations
JWT, tokens, passwords, biometric
Weak algorithms, hardcoded keys
Sensitive data in logs and errors
Bridge security, deep links, integrity
API keys (27+ patterns)
Test credentials, debug endpoints
Manifest, Keystore, permissions
Info.plist, ATS, Keychain
Dangerous permissions
App configuration issues
Third-party SDK risks
Storage Security 5 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).
Network Security 2 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.
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 7 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.
Cryptography 2 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.
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 Specific 8 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.
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 9 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.
iOS Security 8 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.
Configuration 2 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.
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 68+ available security rules with the command:
rnsec rules