base / base/webauthn-sol

Update S if S > N/2 instead return false

Open
#29 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Solidity
Stars
290
Forks
126
PR merge metrics
No merged PRs in 30d

Description

https://github.com/base-org/webauthn-sol/blob/619f20ab0f074fef41066ee4ab24849a913263b2/src/WebAuthn.sol#L110

When verify webauth signature. In case `S value > _P256_N_DIV_2`, library will return false. But we can Canonical S- value to preventing the creation of a second valid signature
```solidity
if (webAuthnAuth.s > _P256_N_DIV_2) {
// guard against signature malleability
webAuthnAuth.s = FCL_Elliptic_ZZ.n - webAuthnAuth.s;
//return false;
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Read src/WebAuthn.sol at line 110 and follow the verification entry point first. Confirm how the S > _P256_N_DIV_2 branch handles webAuthnAuth.s; done means the branch canonicalizes the S value instead of returning false, preventing creation of a second valid signature.

Written by the indexing model from the issue text.

Assessment

Tech stack
solidity
Domain
cryptography, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.