FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update documentation to avoid PIN bypass by tcannonfodder · Pull Request #372 · cedarcode/webauthn-ruby · GitHub

Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .md  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
8 changes: 6 additions & 2 deletions README.md
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
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@ begin
webauthn_credential.verify(
session[:authentication_challenge],
public_key: stored_credential.public_key,
sign_count: stored_credential.sign_count
sign_count: stored_credential.sign_count,
user_verification: true, # needed for passwordless verification

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think we should also add this to creation options in the initiation phase of the Credential Registration ceremony 🙂

)

# Update the stored credential sign count with the value from `webauthn_credential.sign_count`
Expand Down Expand Up @@ -384,11 +385,14 @@ Verifies the asserted WebAuthn credential is [valid](https://www.w3.org/TR/webau
Mainly, that the client provided a valid cryptographic signature for the corresponding stored credential public
key, among other extra validations.

Note that the `user_verification: true` flag is required to ensure that the the authenticator has verified the user's identity before sending the credentials. See the following [CVE-2020-8236 writeup](https://hwsecurity.dev/2020/08/webauthn-pin-bypass/)

```ruby
credential_with_assertion.verify(
session[:authentication_challenge],
public_key: stored_credential.public_key,
sign_count: stored_credential.sign_count
sign_count: stored_credential.sign_count,
user_verification: true # needed for passwordless verification

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We should also add this for PublicKeyCredentialWithAttestation#verify 🙂

Also, we could also add it to the params of this method in line 381.

)
```

Expand Down
6 changes: 4 additions & 2 deletions docs/advanced_configuration.md
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
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ session[:creation_challenge] = options.challenge
begin
webauthn_credential = relying_party.verify_registration(
params[:publicKeyCredential],
params[:create_challenge]
params[:create_challenge],
user_verification: true
)

# Store Credential ID, Credential Public Key and Sign Count for future authentications
Expand Down Expand Up @@ -147,7 +148,8 @@ begin
# in params[:publicKeyCredential]:
webauthn_credential, stored_credential = relying_party.verify_authentication(
params[:publicKeyCredential],
session[:authentication_challenge]
session[:authentication_challenge],
user_verification: true
) do
# the returned object needs to respond to #public_key and #sign_count
user.credentials.find_by(webauthn_id: webauthn_credential.id)
Expand Down

Back | FazBrowse Home | New Git URL