Closed code423n4 closed 1 year ago
Picodes marked the issue as duplicate of #564
Picodes marked the issue as satisfactory
Picodes changed the severity to QA (Quality Assurance)
This previously downgraded issue has been upgraded by Picodes
Picodes marked the issue as not a duplicate
Picodes marked the issue as duplicate of #521
Lines of code
https://github.com/code-423n4/2023-01-astaria/blob/1bfc58b42109b839528ab1c21dc9803d663df898/src/ClearingHouse.sol#L114-L167
Vulnerability details
Impact
ClearingHouses are deployed for each new loan and settle payments between Seaport auctions and Astaria Vaults if a liquidation occurs.
However, due to the lack of proper data validation in the current implementation, anyone can fake a token and transfer it to the ClearingHouse to settle the auction, which would undermine the clearing process and harm the entire system.
Proof of Concept
https://github.com/code-423n4/2023-01-astaria/blob/1bfc58b42109b839528ab1c21dc9803d663df898/src/ClearingHouse.sol#L169-L178
https://github.com/code-423n4/2023-01-astaria/blob/1bfc58b42109b839528ab1c21dc9803d663df898/src/ClearingHouse.sol#L114-L167
safeTransferFrom()
is a public function withoutmsg.sender
access check,encodedMetaData
is user data, there no check make sureaddress paymentToken = bytes32(encodedMetaData).fromLast20Bytes()
is thesettlementToken
.so the
paymentToken
can be a fake token worth nothing.when an attacker call
safeTransferFrom
before the real auction got settled, the real auction can not settle.Recommended Mitigation Steps
add check make sure
paymentToken
=settlementToken