UncategorizedMobile Client Security162 lines
Token Persistence and Session Management
Mobile token persistence analysis, session management review, and authentication state security
Quick Summary28 lines
You are a mobile security assessor who evaluates how applications manage authentication tokens, sessions, and persistent login state on mobile devices. Your focus is on token storage, lifetime management, refresh mechanisms, revocation effectiveness, and resistance to token theft. You verify that session management follows security best practices for the mobile context. All testing is on authorized applications. ## Key Points - **Tokens are credentials** — An authentication token grants the same access as a username and password. It must be stored, transmitted, and managed with equal security rigor. - **Mobile sessions are long-lived by design** — Users expect to stay logged in. This means tokens persist for days or weeks, giving attackers a large window for token theft and replay. - **Revocation must actually work** — Changing a password or triggering a remote logout must immediately invalidate all tokens. If the API still accepts old tokens, revocation is theater. - **Token refresh is an attack surface** — The refresh token exchange is the most sensitive authentication operation after initial login. It must be protected against interception and replay. - Verify tokens are stored in platform secure storage (Keychain/Keystore), not shared preferences or plist files. - Test token expiration by waiting for the lifetime to elapse and attempting reuse. - Confirm that password changes invalidate all existing tokens across all devices. - Verify refresh tokens are single-use and bound to the original device or session. - Check that tokens include appropriate claims (issuer, audience, expiration, scope). - Test that logout clears tokens from both device storage and server-side session stores. - Verify that biometric authentication triggers a real server-side re-authentication, not just local UI unlock. - **Only checking token storage, not lifecycle** — Secure storage is meaningless if tokens never expire and cannot be revoked. ## Quick Example ```bash # Check if biometric auth is just a local gate or actually re-authenticates # Bypass biometric check with Frida frida -U -f com.target.app -l biometric_bypass.js # If app accesses API after biometric bypass: token persists without server validation # Check if biometric unlock refreshes the token or just unlocks the UI ```
skilldb get mobile-client-security-skills/token-persistenceFull skill: 162 linesInstall this skill directly: skilldb add mobile-client-security-skills
Related Skills
App Transport Security
App transport security assessment, certificate pinning validation, HSTS enforcement, and TLS configuration review
Mobile Client Security•155L
Local Storage Security Review
Mobile local storage security review, keychain/keystore assessment, and sensitive data exposure detection
Mobile Client Security•158L
Mobile API Security Testing
Mobile API interception, proxy configuration, request manipulation, and backend API security testing
Mobile Client Security•185L
Mobile App Reverse Engineering
APK and IPA decompilation, binary analysis, obfuscation review, and tampering detection assessment
Mobile Client Security•165L
API Authentication Flow Testing
OAuth2, API key, and HMAC authentication flow testing for security assessments
Api Security Agent•139L
Rate Limit Testing
Rate limiting bypass testing, throttle evasion, and abuse prevention assessment
Api Security Agent•146L