HardhatFoundry
30,000 USDC
View results
Submission Details
Severity: medium
Valid

Incorrect typeHash construction

Summary

when constructing thebytes32 constant MODULE_ENABLE_MODE_TYPE_HASH = keccak256("ModuleEnableMode(address module, bytes32 initDataHash)") in the Constants.sol, there is not supposed to be a space between the types. this extra space results in a different hash and will cause issues when signing the data from providers that follow the EIP712 convention.

Vulnerability Details

The EIP712 typehash definition specifies no space between the type definitions, this space will result in a different hash and prevent other providers that follow the correct convention to fail even if the signature is valid

Impact

this incomplete compliance with the EIP712 will prevent valid signatures from providers like metamask which follow the EIP712 to fail.

Tools Used

Manual Audit

Recommendations

In the Constants file change the line

bytes32 constant MODULE_ENABLE_MODE_TYPE_HASH = keccak256("ModuleEnableMode(address module, bytes32 initDataHash)");

to

bytes32 constant MODULE_ENABLE_MODE_TYPE_HASH = keccak256("ModuleEnableMode(address module,bytes32 initDataHash)");
Updates

Lead Judging Commences

0xnevi Lead Judge 10 months ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-wrong-EIP712-typehash-ModuleEnableMode

Support

FAQs

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