Repository navigation
fix(webauthn): verify assertion against stored signature count - #20029
Open
Sudhakar7J wants to merge 1 commit into
Open
Sudhakar7J wants to merge 1 commit into
Sudhakar7J wants to merge 1 commit into
Conversation
Webauthn4JRelyingPartyOperations built the webauthn4j CredentialRecord from the stored attestation object, so the counter check compared the assertion's signCount against the registration-time value instead of the latest value persisted after each successful authentication. This disabled clone detection for authenticators that implement a signature counter. Build the CredentialRecord with the stored signature count, carrying over the attestation statement, UV/BE/BS flags, attested credential data, extensions, and transports. Add a regression test asserting the counter passed to webauthn4j is the stored value. Fixes spring-projectsgh-19994 Signed-off-by: Sudhakar <sudhakar.jeeva7@gmail.com>
This branch has not been deployed
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.
Summary
Webauthn4JRelyingPartyOperations.authenticate(...)built the webauthn4jCredentialRecordfrom the stored attestation object, so webauthn4j compared the assertion'ssignCountagainst the registration-time value instead of the latest value persisted after each successful authentication. The storedsignatureCountwas written but never used for verification, disabling clone detection for authenticators that implement a signature counter.Fix: build the
CredentialRecordwith the stored signature count, carrying over the attestation statement, UV/BE/BS flags, attested credential data, extensions, and transports.Changes
Webauthn4JRelyingPartyOperations.java: buildCredentialRecordImplvia the explicit-parameter constructor withcredentialRecord.getSignatureCount().Webauthn4jRelyingPartyOperationsTests.java: regression test asserting the counter passed to webauthn4j is the stored value.Testing
Result: BUILD SUCCESSFUL (full module suite). New test:
authenticateThenWa4jCredentialRecordUsesStoredSignatureCount.Related
Checklist