Skip to content

Mount better defenses against malicious cert chains in Android Key attestations - #821

Merged
MasterKale merged 5 commits into
masterfrom
fix/817-android-key-check-root-cert-earlier
Oct 28, 2026
Merged

MasterKale merged 5 commits into
masterfrom
fix/817-android-key-check-root-cert-earlier

Conversation

@MasterKale

Copy link
Copy Markdown
Owner

This PR moves some validation logic around in verifyAttestationAndroidKey() to prevent malicious "android-key" attestations from getting a chance to execute arbitrary network requests within the RP's server. Now, the responses's x5c trust anchor must be a recognized one (SimpleWebAuthn registers Google's Android Key trust anchors as defaults via SettingsService) before certificate chain validation is attempted and then subsequently attempts network-heavy CRL checks assuming x5c forms a valid certificate chain.

An additional error is now thrown if for some reason the RP clears out "android-key" attestation trust anchors before attempting to verify such an attestation statement. Android Key attestation statements are unique in that they form a complete chain already, and simply allowing the certificate chain to be evaluated without checking that the final cert is a known one leads to can allow for attackers to trigger arbitrary network requests. This is why it's important that the RP specify trusted anchor certificates for this format in particular, hence the need to "fail closed" here.

Fixes #817.

@MasterKale MasterKale added the package:server @simplewebauthn/server label Oct 28, 2026
@MasterKale
MasterKale merged commit 6a87602 into master Oct 28, 2026
15 checks passed
@MasterKale
MasterKale deleted the fix/817-android-key-check-root-cert-earlier branch October 28, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package:server @simplewebauthn/server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"android-key" cert chain validation needs to check that the chain's root cert is a known one before validating the chain

1 participant