There is no control code in the function cancel() to determine which status can be canceled. If the order maker cancels the order through an attacking contract after it has been filled. There will be ambiguity in contract logic -- a canceled order will still be executed.
Recommended Mitigation Steps
Add order status variable to struct order and add control process.
Lines of code
https://github.com/code-423n4/2022-06-putty/blob/3b6b844bc39e897bd0bbb69897f2deff12dc3893/contracts/src/PuttyV2.sol#L526-L535
Vulnerability details
Impact
function cancel()
to determine which status can be canceled. If the order maker cancels the order through an attacking contract after it has been filled. There will be ambiguity in contract logic -- a canceled order will still be executed.Recommended Mitigation Steps
Add order status variable to
struct order
and add control process.