You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Get rid of the consumed_at column and the UPDATE setting it.
Instead, rely on the unique constraints on challenge,
which will cause the INSERT to fail for a replay attack.
Also:
* Create and use ENUMs from the WebAuthn specification:
- credential_type
- user_verification_requirement
* Parameterize txAuthSimple and txAuthGeneric
* Check timeout is not exceeded by comparing against created_at
* Check the user_handle must match the credential’s user_id, or be NULL
* Implement and test userVerification semantics
* Add COMMENTS on all tables and their columns
AND challenge =webauthn.base64url_decode(webauthn.from_utf8(webauthn.base64url_decode(client_data_json))::jsonb->>'challenge')
24
+
AND ((webauthn.parse_attestation_object(webauthn.base64url_decode(attestation_object))).user_verified ORcredential_challenges.user_verification<>'required')
COMMENT ON TABLE webauthn.assertion_challenges IS 'Used by webauthn.get_credentials() to store the challenge, which is then consumed by webauthn.verify_assertion().';
19
+
20
+
COMMENT ON COLUMN webauthn.assertion_challenges.challenge IS 'https://www.w3.org/TR/webauthn-2/#dom-collectedclientdata-challenge';
21
+
COMMENT ON COLUMN webauthn.assertion_challenges.relying_party_id IS 'https://www.w3.org/TR/webauthn-2/#relying-party-identifier';
22
+
COMMENT ON COLUMN webauthn.assertion_challenges.user_name IS 'https://www.w3.org/TR/webauthn-2/#dom-publickeycredentialcreationoptions-user';
23
+
COMMENT ON COLUMN webauthn.assertion_challenges.timeout IS 'https://www.w3.org/TR/webauthn-2/#dom-publickeycredentialrequestoptions-timeout';
24
+
COMMENT ON COLUMN webauthn.assertion_challenges.tx_auth_simple IS 'https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredentialRequestOptions/extensions';
25
+
COMMENT ON COLUMN webauthn.assertion_challenges.tx_auth_generic_content_type IS 'https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredentialRequestOptions/extensions';
26
+
COMMENT ON COLUMN webauthn.assertion_challenges.tx_auth_generic_content IS 'https://developer.mozilla.org/en-US/docs/Web/API/PublicKeyCredentialRequestOptions/extensions';
27
+
COMMENT ON COLUMN webauthn.assertion_challenges.created_at IS 'Timestamp of when the challenge was created by webauthn.get_credentials()';
0 commit comments