Signatures can be reused across forks #430
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
invalid
This doesn't seem right
responded
The Holograph team has reviewed and responded
sponsor disputed
Sponsor cannot duplicate the issue, or otherwise disagrees this is an issue
Lines of code
https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/HolographERC20.sol#L244
https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/abstract/EIP712.sol#L83-L89
Vulnerability details
Impact
In the case of a hard fork, the same signature can be considerd valid on both chains due to the lack on
block.chainid
computation inHolographERC20.permit()
.Proof of Concept
The
block.chainid
will be used during initialization forHolographERC20.init()
andEIP712_domainSeparatorV4()
.https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/enforcer/HolographERC20.sol#L244
https://github.com/code-423n4/2022-10-holograph/blob/main/contracts/abstract/EIP712.sol#L83-L89
In the event of a hard fork, approvals via permit on one chain will be considered valid on the other chain.
Recommended Mitigation Steps
Include the chainid on
HolographERC20.permit()
hash schema to prevent double spending and replay attacks in the case of a chainsplit/hard fork.The text was updated successfully, but these errors were encountered: