Appearance
Mobile app attestation
Symptoms of mobile app attestation: Google Play Integrity tokens and Apple App Attest registrations and assertions, and the keys and devices they use.
Storing a Play Integrity key is refused
- Symptom: the Keys card or
waap api attest key setanswers 403 or 422. - Cause: 403: only administrators store or remove keys. 422: the decryption key is not base64 of 32 bytes, the verification key is not an EC P-256 public key (PEM, base64 DER or DER), the kind is not
play-decryptorplay-verify, or the verifier name has unusual characters. - Check:
waap api attest keys -app NAME; the Mobile attestation page warns about verifiers that still lack a key. - Fix: copy the keys again from the Play Console (the AES key as base64, the public key as shown).
Revoking a device or checking a token fails
- Symptom:
waap api attest device revokeor the Revoke button answers 404 or 422; the token check answers 422 or "The check could not finish". - Cause: 404: the ID is not (or is no longer) registered for this application. 422: the ID is not the 64 hex characters of the list (a clipped ID from a viewer cannot be used), the token is empty or over 16 KiB, the body is over 64 KiB, or the application has no attestation verifiers. "Could not finish": the device store could not be read, or the 3-second budget ran out.
- Check:
waap api attest devices -app NAMEfor the full IDs;waap api list get -app NAME -list attestation.verifiers; the control node log. - Fix: copy the ID from the list as an operator; add a verifier; retry the check. A refused token with
attest.bindingin the check usually means the method, path, query or body entered differs from what the app hashed.
Every Play Integrity token is refused with attest.invalid
- Cause: the verifier's decryption or verification key was not uploaded, is not the one in the Play Console (keys were regenerated there), or the app still uses Google-managed keys.
- Check: the event message ("no decryption key uploaded for verifier ...", "does not decrypt", "signature does not verify"); the keys listed for the application.
- Fix: download both keys again from the Play Console and upload them for that verifier.
Valid calls are refused with attest.binding
- Cause: the app computes the request hash differently (the path with or without the query, body bytes changed after hashing, or upper-case hex); or the body is larger than the inspected limit, so it cannot be hashed; or a challenge was fetched for another application.
- Check: compute the hash for one call by hand (
METHOD\nPATH?QUERY\nhex(SHA-256(body)), SHA-256, then base64url without padding) and compare it with the token's value. - Fix: fix the app's hashing; use
binding: challengeon upload paths.
attest.expired on calls that just got a token
- Cause: the node's clock is off, the app caches tokens longer than
max_age, or a challenge older than 5 minutes is reused. - Check: NTP status on the nodes; the timestamp in the event message.
- Fix: sync the clocks; request a fresh token per call; raise
max_age(at most 1 hour).
attest.device for real phones
- Cause: the device only meets basic integrity (an unlocked bootloader, a custom ROM, an emulator), while the verifier asks for
MEETS_DEVICE_INTEGRITY. - Fix: this is expected for such devices. If they must be served, add
MEETS_BASIC_INTEGRITYtodevice_verdicts, which gives weaker protection.
attest.replay when the app retries a call
- Cause: Play Integrity and JWT tokens are single use by default, so a retry with the same token looks like a replay.
- Fix: get a new token for the retry, or set
single_use: falseon that verifier.
App Attest registration answers 403
- Cause: the event's rule says why:
attest.binding(the attestation was made for another challenge, or the challenge is forged),attest.expired(the challenge is older than 5 minutes),attest.app(the team ID or bundle ID differs, or a development build is sent againstenvironment: production), orattest.invalid(the chain is not from Apple, or the key ID does not match). - Check: the event on the registration path; the app's entitlement (
com.apple.developer.devicecheck.appattest-environment). - Fix: register with a fresh challenge. Set
environment: developmentfor test builds, as a separate verifier.
The challenge endpoint answers 503 not_ready
- Cause: the application's challenge key does not exist yet. The active control node creates it within a minute of saving attestation settings that use challenges.
- Check: the control node is up and active; its log for "rotating the attest-challenge key".
- Fix: wait a minute, then check the control node.
attest.unknown_key after a reinstall or a revocation
- Cause: a reinstalled app has a new key and must register again. A revoked key, or one pruned after 180 days unused, is gone. On another node a new registration is seen within a minute.
- Fix: have the app register again when it gets
attest.unknown_key.
attest.counter for a device that worked before
- Cause: a replayed assertion, or two assertions sent out of order by the app.
- Fix: the app must send assertions in the order it makes them. A real replay is an attack.
The registration endpoint answers 429
- Cause: more than 10 registrations per minute from one address, either a flood or many devices behind one NAT during a launch.
- Fix: retry after a minute. Legitimate apps register once per install.