Project

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

Improper Domain Separator Hash in EIP712Base

Summary

The EIP712_DOMAIN_TYPEHASH defined in the EIP712Base contract uses an incorrect type hash which does not match the format of data it is supposed to represent.

Vulnerability Details

The EIP-712 standard specifies a domain separator format using the type hash for the following data structure:

EIP712 Domain (string name, string version, uint256 chainId, address verifyingContract)

However, in the current implementation:

struct EIP712Domain {
string name;
string version;
address verifyingContract;
bytes32 salt;
}
bytes32 internal constant EIP712_DOMAIN_TYPEHASH = keccak256(
bytes(
"EIP712Domain(string name,string version,address verifyingContract,bytes32 salt)"
)
);

The variable EIP712_DOMAIN_TYPEHASH should conform to the correct structure as defined by the EIP-712 standard. The EIP712 Domain should include a uint256 chainId instead of a fixed bytes32 salt. The discrepancy is not just a minor oversight but a critical adherence issue that affects the integrity of the domain separator, leading to potential misuse or exploitation.

Impact

Signature Verification Failure: Because the type hash used in the domain separator does not match the required format, any off-chain signatures generated expect the domain to be compliant with EIP712Domain will not match the calculated on-chain domain separator. As a result, all such signature verifications will fail.

Tools Used

Manual Review

Recommendations

Consider using openzeppelin's [EIP712](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.2/contracts/utils/cryptography/EIP712.sol)

Updates

Lead Judging Commences

0xbrivan2 Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Known issue

Support

FAQs

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