Abstract
SMS One-Time Passwords (OTPs) are a cornerstone of mobile authentication, yet their security relies entirely on the unpredictability of server-side Pseudo-Random Number Generators (PRNGs). This paper investigates the security of these systems by introducing OTP-Lint, a black-box dynamic analysis tool designed to evaluate OTP randomness without access to server-side source code. By analyzing 2,022 Android apps, the study reveals that nearly 20% generate predictable OTPs, exposing users to account hijacking via guessing and replay attacks.
Introduction
SMS OTPs are a standard method for user authentication, relying on the assumption that generated numbers are uniquely unpredictable. This unpredictability depends on secure PRNGs. However, developers often implement PRNGs incorrectly—for example, by using static seeds, predictable timestamps, or cryptographically insecure algorithms like Mersenne Twister.
A major roadblock for security researchers is that OTP generation happens on the server side, making traditional static code analysis impossible. To address this, the authors developed a method to assess the cryptographic security of these server-side PRNGs purely from the outside by observing the OTP sequences sent to the client device.
Methodology: The OTP-Lint Pipeline
The authors developed OTP-Lint, an automated dynamic analysis tool that evaluates OTP randomness through a three-stage pipeline:
- Authentication Locator: Identifying login screens is challenging due to custom variable naming.
OTP-Lintuses a fuzzing-inspired approach combined with Natural Language Processing (NLP) to identify loginActivitycomponents based on code dependencies rather than simple keyword matching. - Request Processor: The tool automatically interacts with the app's UI using Android's UI Automator and Monkey. It inputs a phone number, triggers the OTP request, and extracts the received OTP directly from the rooted device's SMS database.
- Vulnerability Detector:
OTP-Lintcollects a sequence of OTPs and tests them against three core randomness rules derived from RFCs and known bad practices: avoiding static values, avoiding specific patterns (like fixed period lengths), and avoiding predictable seeds.
Experimental Setup
The authors analyzed 6,431 top-listed Android apps across 21 categories from Google Play (1,000 apps) and Tencent MyApp (5,431 apps). Out of these, OTP-Lint successfully identified 2,022 apps that actively implemented SMS OTP login, forming the core dataset for randomness evaluation.
Key Results and Findings
The analysis revealed widespread vulnerabilities in the implementation of SMS OTPs across the mobile ecosystem. Out of 2,022 apps tested, 399 apps (19.7%) generated predictable OTPs that violated basic randomness rules.
Major Vulnerabilities Identified:
- Static OTPs: 41 apps used a completely static OTP value for every login attempt.
- Insecure Algorithms: 162 apps generated a repeated sequence of OTPs with a fixed period length of 624, strongly indicating the use of the insecure Mersenne Twister (MT19937) algorithm. The authors successfully reversed the seeds for all of these apps using off-the-shelf tools.
- Predictable Binary Patterns: 125 apps generated OTPs with predictable binary representations, such as shifting binary digits iteratively, which drastically reduces the search space for an attacker.
- Single Point of Failure: 194 of the vulnerable apps relied on OTP as their sole authentication mechanism (no password required), leaving them completely exposed to account takeovers.
Discussion and Insights
The study highlights a phenomenon of "Security Theater," where apps implement OTPs that appear random to humans in decimal format but are cryptographically trivial to predict. By analyzing GitHub and Stack Overflow, the authors found that developers frequently copy-paste insecure PRNG initialization code, such as seeding with a constant value. Furthermore, even when OTPs look random in base-10, converting them to binary often reveals simple bit-shifting operations or parity patterns that compromise security.
Conclusion and Future Work
OTP-Lint demonstrates that a significant portion of the Android ecosystem is vulnerable to OTP prediction attacks. While effective, the tool currently relies on predefined rules extracted from known bad code. Future work aims to incorporate more robust, generalized statistical tests, such as the NIST SP 800-22 suite, to evaluate the randomness of unseen PRNGs and overcome challenges posed by code obfuscation and packing.
Summary updated