The issue was a missing check for ECDSA signature malleability in Verification.verify().
Mitigation review - mitigated with error
Verification.sol has been overhauled and now uses OpenZeppelin's ECDSA library, which only allows s in the lower half order.
The order of parameters of verify() was changed, and the corresponding changes have been made in calls to verify().
This mitigation includes the Error below.
Related to this mitigation is the mitigation of H-03 which added a signature check in FighterFarm.redeemMintPass(). This is also impacted by the Error of this mitigation.
Mitigation Error - toEthSignedMessageHash() is not in ECDSA.sol.
Lines of code
Vulnerability details
Mitigation of ADD-02: Mitigated with Error
Mitigated issue
L-02 in #507
The issue was a missing check for ECDSA signature malleability in
Verification.verify()
.Mitigation review - mitigated with error
Verification.sol has been overhauled and now uses OpenZeppelin's ECDSA library, which only allows
s
in the lower half order. The order of parameters ofverify()
was changed, and the corresponding changes have been made in calls toverify()
.This mitigation includes the Error below.
Related to this mitigation is the mitigation of H-03 which added a signature check in
FighterFarm.redeemMintPass()
. This is also impacted by the Error of this mitigation.Mitigation Error -
toEthSignedMessageHash()
is not in ECDSA.sol.L20:
will revert because
toEthSignedMessageHash()
is located in MessageHashUtils.sol.This breaks
AAMintPass.claimMintPass()
,FighterFarm.claimFighters()
andFighterFarm.redeemMintPass()
, which callVerification.verify()
.Recommended Mitigation of Error
Remaining Low risk issue - no chainId in hash
The chainId is not included in the message hash, so cross-chain replay could be possible, if this were to be also deployed on other chains.