Reversing 'France Identité': the new French digital ID.
The France Identité app's custom end-to-end encrypted channel between the app and backend had several cryptographic and logic flaws, including an AES-GCM IV reuse vulnerability that allowed a man-in-the-middle attacker to decrypt messages, and a failure to validate the app's identity in the attestation certificate, allowing a cloned app to access the backend API.
Published on reversemode.com
October 04, 2023
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the counter used to generate the IV for AES-GCM encryption was not strictly controlled across different message flows, allowing the same IV to be reused, and the backend failed to validate the ApplicationID field in the attestation certificate.
Impact
A man-in-the-middle attacker could decrypt messages in the secure channel, potentially leading to fraud, impersonation, and identity theft; additionally, a cloned app could access the backend API.
What the attacker needed
Man-in-the-middle position; ability to intercept and modify traffic
The fix
The E2EE Secure Channel was updated to be mostly based on TLS 1.3, and the three other vulnerabilities were fixed in a released version.
How it was found
- The attacker performs a man-in-the-middle during the E2EE Secure Channel handshake.
- The attacker intercepts a 'Transaction Start' request from the app and prevents it from reaching the backend.
- The attacker sends a request to a specific endpoint with the secure channel ID header, forcing the backend to generate an encrypted response with the same counter value as the intercepted request.
- The attacker now has two messages encrypted with the same IV and can decrypt the target message using a chosen-plaintext attack.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
The France Identité app uses a special encrypted channel to talk to its servers, like a secret code that only the app and server know. The researchers found that an attacker who can intercept the connection could sometimes trick the app and server into reusing the same secret code number, which breaks the encryption and lets the attacker read the messages. They also found that the server didn't check properly that the app connecting to it was the real France Identité app, so a fake app could also connect.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.