Project

One World
NFTDeFi
15,000 USDC
View results
Submission Details
Severity: low
Invalid

Missing validation checks for v value in signature

Impact

The validation checks for v value in the signature is missing.

Description

The v value for the signature in the components, v, r & s should be either 27 or 28 which is the valid value, but the check for the same is missing in NativeMetaTransaction::verify() function

function verify(address signer, MetaTransaction memory metaTx, bytes32 sigR, bytes32 sigS, uint8 sigV)
internal
view
returns (bool)
{
// @audit - verify v value is within a valid range, require(v == 27 || v == 28);
require(signer != address(0), "NativeMetaTransaction: INVALID_SIGNER");
return signer == ecrecover(toTypedMessageHash(hashMetaTransaction(metaTx)), sigV, sigR, sigS);
}

Tools Used

Manual Review

Recommendation

Add the following require check for the v value.

function verify(address signer, MetaTransaction memory metaTx, bytes32 sigR, bytes32 sigS, uint8 sigV)
internal
view
returns (bool)
{
+ require(v == 27 || v == 28, "invalid v value in signature");
require(signer != address(0), "NativeMetaTransaction: INVALID_SIGNER");
return signer == ecrecover(toTypedMessageHash(hashMetaTransaction(metaTx)), sigV, sigR, sigS);
}
Updates

Lead Judging Commences

0xbrivan2 Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.