The OneWorld Project aims to support the EIP-712 standard for typed data hashing and signing. However, the current implementation in the EIP712Base.sol contract does not fully comply with the standard, which could lead to unexpected issues.
The vulnerability arises in the EIP712Base.sol contract, where the chainId is omitted from the domain separator hash. According to the EIP-712 standard, the domain separator should include the chainId to prevent certain security risks and ensure compatibility with other systems.
The relevant section in EIP712Base.sol is as follows:
As we can see chainId is omitted in DOMAIN_TYPEHASH. As well as we can see that while setting the domain separator itself we again omit the chainId
Thus the protocol does not follow the standard’s approach of directly including chainId in the domain separator, which can impact compatibility with other compliant protocols and tools.
Not following the standard can result in several issues:
Interoperability Issues: Tools and protocols that expect strict EIP-712 compliance might not work correctly with this contract.
Broken Integrations: Applications that use this contract may experience issues when interacting with wallets or other dApps designed around full EIP-712 compliance.
Without chainId in the domain separator, the contract could be vulnerable to replay attacks if deployed on multiple chains, even with salt derived from chainId. While this approach provides some protection, it is not the recommended method for preventing replay attacks, and attackers could exploit this vulnerability. Therefore, it is advised to follow the standard recommendation to include chainId in the domain separator to ensure robust protection against replay attacks.
Manual code review
Add chainId to the domain separator to fully comply with the standard. The updated code would look like this:
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.