-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The userOps using webauthn must get lesser verificationGasLimit
during gas estimation
#108
Comments
verificationGasLimit
during gas estimation
raymondfam marked the issue as sufficient quality report |
raymondfam marked the issue as primary issue |
Will let the sponsor review it but the mitigation step seems infeasible. |
This is a general problem with eth_estimateUserOperationGas. You want to construct a dummy signature that will match as closely as possible to the real signature, so that validation proceeds and you can get an accurate gas estimation. We have been using this for months with no issue. |
wilsoncusack (sponsor) disputed |
It is common practice to submit regular transactions with a gas limit that includes a margin on top of what's simulated, or at least re-simulating the final transaction before sending it. Worth keeping this as QA though. |
3docSec changed the severity to QA (Quality Assurance) |
3docSec marked the issue as grade-a |
Lines of code
https://github.com/code-423n4/2024-03-coinbase/blob/main/src/SmartWallet/CoinbaseSmartWallet.sol#L321
https://github.com/code-423n4/2024-03-coinbase/blob/main/src/WebAuthnSol/WebAuthn.sol#L122-L128
Vulnerability details
Impact
The userOps using webauthn must get lesser
verificationGasLimit
when callingeth_estimateUserOperationGas
api to estimate the gas values for a UserOperation.With lesser
verificationGasLimit
, those userOps will be rejected by bundlers.Proof of Concept
op
has unset gas fields.op
will be set to a dummy webauthn signature where current userOpHashhash1
is encoded aschallenge
ofwebAuthn
.eth_estimateUserOperationGas
api of bundler with currentop
.op.verificationGasLimit = some_value_bundler_want_to_try
hash2
.hash1
is not equal tohash2
, the gas estimation will exit early here and result in a estimatedverificationGasLimit
which does not cover the following checks.verificationGasLimit
.verificationGasLimit
of userOp will be set to a lesserverificationGasLimit
from gas estimation.op
with a lesserverificationGasLimit
will be rejected by bundlers.Relate info about this findings
Recommended Mitigation Steps
userOpHash
to userOp.signature.Assessed type
Other
The text was updated successfully, but these errors were encountered: