[Security] - Experiment migrating to fido2 2.2.0 - #2663
Merged
Conversation
In version >=2.0.0 of fido2 CBOR encoding was dropped in favour of JSON compatible dicts, changing the API contract between admin and api.
🧪 Review environmenthttps://dkmisvrqwbgekddhoqemuxehe40vphdu.lambda-url.ca-central-1.on.aws/ |
6 tasks
- Enabled `WebAuthentication` in Cypress. - Diabled `WebAuthenticationBluetooth` and `WebAuthenticationCable` to limit Cypress to virtual authenticators only
whabanks
marked this pull request as ready for review
April 20, 2026 16:20
jzbahrai
approved these changes
Apr 21, 2026
- In fido2 v1 the `challenge` is contained in a `publicKey` key, in v2 these data elements are top level, which caused them to be missed when packaged for `navigator.credentials`. This should resolve cypress test failures - Updated some unit test mocks to accurately reflect new v2 JSON formats
Cypress tests related to security keys were failing because the API image built to run the tests against is from main, which does not yet contain the code migrating from fido2 1.x.x -> 2.2.0, so the expected responses are structured differently. These should pass once that code is merged
Contributor
Author
|
Cypress tests will fail here until cds-snc/notification-api#2836 is merged |
3 tasks
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 | Résumé
We need to bump
cryptographyin utils to patch a vulnerability. However, this also requires migrating tofido2 >= 2.2.0in API, asfido2transitively pulls incryptographyand2.2.0is the latest version that includes a patchedcryptographyversion.In
fido2 >= 2.0.0CBORencoding has been dropped in favour ofJSONencoding. Changing the data shape and endpoint contract between API and Admin. This PR aims to update the contract to be compatible with the API change made here.Key changes:
CBORencode/decode usage inuser_api_clientanduser_profileCBORencode/decode to JSON and build a standardWebAuthnresponse infido2.jswhen building registration and authentication responses.Test instructions | Instructions pour tester la modification
poetry installin API andnpm run tailwindin admin before continuing