The toTypedMessageHash
function accepts a pre-computed messageHash
parameter instead of computing hashStruct(message)
as required by the EIP-712 specification. This deviation from the standard could lead to signature verification issues and potential security vulnerabilities.
Current Implementation:
According to EIP-712:
The final encoding should be: "\x19\x01" ‖ domainSeparator ‖ hashStruct(message)
Where hashStruct(message) is defined as: keccak256(typeHash ‖ encodeData(message))
The function currently accepts an arbitrary messageHash without enforcing proper struct hashing
The implementation takes a shortcut by accepting a pre-computed hash instead of implementing the full EIP-712 structured data hashing mechanism. This violates the standard's requirement for type-safe hashing and proper domain separation.
The EIP-712 standard requires specific structured data handling where:
Each struct type has a defined typeHash
Struct data is encoded according to specific rules
The hashStruct function combines these in a standardized way
The current implementation bypasses these requirements by accepting any arbitrary hash, potentially breaking the type-safety guarantees that EIP-712 provides.
Breaks EIP-712's type-safety guarantees
No guarantee that the provided hash represents a properly encoded struct
May lead to signature verification issues across different implementations
Potential for signature malleability if hashes aren't properly structured
Manual Review
Implement hashStruct
in the code too i.e:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.