Repository navigation
Mount better defenses against malicious cert chains in Android Key attestations - #821
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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'sx5ctrust anchor must be a recognized one (SimpleWebAuthn registers Google's Android Key trust anchors as defaults viaSettingsService) before certificate chain validation is attempted and then subsequently attempts network-heavy CRL checks assumingx5cforms 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.