Closed code423n4 closed 2 years ago
It's intended behaviour of using isValidSignature that a signature can be dynamically revoked. This is no different than a contract cancelling an order or revoking ERC20 approval permissions on an asset to prevent the order being filled.
agree with sponsor. it's a feature, not bug.
Lines of code
https://github.com/code-423n4/2022-06-putty/blob/main/contracts/src/PuttyV2.sol#L278
Vulnerability details
Impact
fillOrder()
utilizesSignatureChecker.isValidSignature()
to check if the signature is valid.However, if order.maker is a contract using ERC1271, the contract can temporarily revoke signature in
SignatureChecker.isValidSignature()
. https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/SignatureChecker.solProof of Concept
For example, contracts are allowed to view price on market before deciding what to return for isValidSignature, giving them power to temporarily revoke options when market price is not in their favor. This is most likely inappropriate and unintended behaviour for the protocol.
fillOrder()
usesSignatureChecker.isValidSignature()
to check if the signature is valid https://github.com/code-423n4/2022-06-putty/blob/main/contracts/src/PuttyV2.sol#L278If
order.maker
is a contract using EIP1271, it could temporarily/dynamically revoke the signature. https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/SignatureChecker.solTools Used
None
Recommended Mitigation Steps
Implement signature validation function in PuttyV2.sol.