Google's instructions for implementing the attestation API are:
Obtain a nonce. Request a SafetyNet attestation. Transfer the response to your server. Use the response on your server, along with your other anti-abuse signals, to control your app's behavior.
I understand the nonce should be obtained from the server. What's to stop an attacker from running two versions of the app - one on a legit device and one on an insecure device and doing the following:
- App on insecure device gets nonce from my server
- App on secure device calls Google's attestation API using this nonce
- App on secure device gets signed JWS response from Google
- Attacker transfers the JWS response to app on insecure device
- App on insecure device sends JWS response to my server
My app server would verify the JWS - including the nonce - and think that the app on the insecure device is actually secure.