-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A malicious borrower is able to brick the Auction when the collateralToken is ERC777 #185
Comments
0xSorryNotSorry marked the issue as sufficient quality report |
0xSorryNotSorry marked the issue as duplicate of #685 |
Trumpero changed the severity to QA (Quality Assurance) |
Trumpero marked the issue as grade-b |
This previously downgraded issue has been upgraded by Trumpero |
Trumpero marked the issue as not a duplicate |
Trumpero marked the issue as duplicate of #184 |
Trumpero marked the issue as satisfactory |
For transparency, the judge has requested for the |
Trumpero marked the issue as unsatisfactory: |
Lines of code
https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/2376d9af792584e3d15ec9c32578daa33bb56b43/src/loan/AuctionHouse.sol#L180-L186
https://github.com/code-423n4/2023-12-ethereumcreditguild/blob/2376d9af792584e3d15ec9c32578daa33bb56b43/src/loan/LendingTerm.sol#L805-L808
Vulnerability details
Impact
When the collateralToken is ERC777, then a malicious borrower is able to brick the Auction and prevent the bidder from claiming/withdrawing the auctioned collateral.
Due to that, the bidder can't bid/claim/withdraw the collateral.
Proof of Concept
When
bid
is called, a portion of collateral will sent-back to the borrower:Then it triggers
onBid
which sends-back that portion of collateral to the borrower:safeTransfer will trigger the
transfer
function ofcollateralToken
, ifcollateralToken
is ERC777 then it triggers thetokensReceived
function of borrower if the borrower is a contract.So a malicious borrower-contract can simply write a
revert()
on its contract (intokensReceived
) which always reverts the transaction.Now there is no way for
bidder
to bid and claim the collateral, because the transaction will be reverted by borrower-contract.Note: There is not mentioned in README and Docs that the ERC777's are not supported for collateralToken and the sponsor confirmed it.
Tools Used
Manual Review
Recommended Mitigation Steps
Consider correct handling of ERC777's collateral tokens.
Assessed type
DoS
The text was updated successfully, but these errors were encountered: