@taichiaudit Founder | Whitehat doing mediations @Immunefi | Core Member @DeFiHackLabs

GMT+8
Joined January 2018
Paid $250 bucks for a mediation and got closed after 25 minutes with this response, stay away from this scam. Do not pay for mediation.
8
1
3
90
5,782
Replying to @chrisdior777
Need to be a good lawyer to get beg bounty
1
6
102
Glad to join the @HackenProof Vanguard program! Will spend more time hunting bugs on HP and share knowledge with the community馃
2
1
29
1,531
Replying to @brandon_shi
Immunefi triaged ones like this?
61
Passed Daml fundamentals cert exam馃榿Thanks @digitalasset for the great intro course
2
1
23
1,711
Translation: you passed verification but we won't allow you to do your regular job, what you gonna do about it kid?
2
1
7
1,462
There is a second bug that makes this path reachable much more easily: the insolvency gate is broken. The comments say liquidation should depend on the borrower鈥檚 shortfall (the underwater amount), but calculateDiscountedRepayToEvenAmount() reads the target account鈥檚 shortfall and then never uses it. You can ctrl+f for accountShortfall_TargetUser and see it is not used anywhere in the contract. Instead, the close cap (the maximum amount of the borrower鈥檚 debt that this liquidation is allowed to repay in one call) is effectively derived from close factor and borrow balance.
1
1
180
During the write phase it stores the borrower-side result, then stores the liquidator-side result. Because both storage variables point to the same slot, the second write overwrites the first one. Net result: the slot ends up with a + b, not a neutral self-transfer. So the liquidation repays real debt but credits extra internal collateral to the attacker.
1
1
98
After that, the code first computes localResults.updatedSupplyBalance_TargetCollateralAsset = localResults.currentSupplyBalance_TargetCollateralAsset - localResults.seizeSupplyAmount_TargetCollateralAsset. It then computes localResults.updatedSupplyBalance_LiquidatorCollateralAsset = localResults.currentSupplyBalance_LiquidatorCollateralAsset + localResults.seizeSupplyAmount_TargetCollateralAsset. You can think of this as localResults.updatedSupplyBalance_TargetCollateralAsset = a - b and updatedSupplyBalance_LiquidatorCollateralAsset = a + b.
1
1
108