Security Research Center
Credential theft: Defense techniques
Defense against reuse of stolen credentials with mobile device binding relies on using device keys to establish connection.
When a new client device is enrolled in the system, it generates a key pair - a private and a public key. The public key is shared with the server and the private key is written to the device TEE. TEE (Trusted Execution Environment) such as Android KeyStore or iOS Keychain guarantees that the generated private key can’t be extracted from the mobile device.
Subsequently, every authentication request is signed using the device key. The server will inspect whether the signature was made with a key that corresponds to any user’s device already enrolled. If the device is unrecognized, the authentication request shall be refused.
If your user authentication payload is always the same (e.g. if this is the username + its password), then the previous code example won’t protect you against replay attack. The attacker can intercept the authentication payload & its signature & replay it since it doesn’t change.
There are many possible ways to harden the basic authentication flow against replay attacks. One of the techniques that is used often - either in conjunction with other techniques or standalone - is a challenge-response technique.
A random one-time challenge, initiated by the server or an independent third party, prevents replay attacks, making generated payloads effectively one-use. The diagram below provides an example of a simple challenge-response flow implementation.
The goal of this example is to demonstrate the key principles behind replay protection. We advise not to implement authentication protocols yourself, and instead refer to authentication standards.
Residual risk: Protecting the initial device enrollment scenario
This device binding defense technique works only when the device has been previously enrolled in the system. The moment of the device enrollment itself is a point of vulnerability. Prior to the device binding, it is sufficient for the user to provide their authentication credentials to enroll their new device in the system.
At this moment typically applications use the strongest and the most strict authentication, including biometric / KYC authentication. It is critical that the authentication uses methods that are the most difficult to recreate manually and require automation. For example, using facial recognition requires the potential attacker to resort to deep fakes to recreate authentication. Combining mobile device binding with mobile application attestation provides the best results to defend against credential theft during the device enrollment process.