Platform: Code4rena
Start Date: 21/06/2022
Pot Size: $55,000 USDC
Total HM: 29
Participants: 88
Period: 5 days
Judge: gzeon
Total Solo HM: 7
Id: 134
League: ETH
Rank: 13/88
Findings: 4
Award: $1,262.76
🌟 Selected for report: 2
🚀 Solo Findings: 1
29.8781 USDC - $29.88
An attacker could abuse the lack of check on aave and pool addresses by creating fake aave and APWine pool contracts. The fake aave could transfer deposited underlying token back to the attacker while the IAPWineRouter pool could do nothing but return any amount that the attacker want. This allows the attacker to mint
principalToken freely
Attacker creates fake aave contract with function named deposit
that receives underlying token from the Lender.sol
and later send it to attacker
Attacker creates fake pool contract with function named swapExactAmountIn
that does not perform any swap but returns any number that the attacker wants
Attacker inputs those addresses in the lend
to perform an attack
Attacker's underlyingToken will initially get transfered to Lender.sol
but after depositing to a fake aave contract, the attacker will get his underlyingToken back
fake pool
returns any amount of principalToken that the attacker wants
Implementing require
to check the eligibility of the external contract before calling
#0 - sourabhmarathe
2022-06-29T12:42:35Z
Duplicate of #349.
🌟 Selected for report: kirk-baird
Also found by: 0xDjango, GalloDaSballo, Kumpa, kenzo, pashov, shenwilly, tintin, unforgiven
54.27 USDC - $54.27
Without the check on address to be approved, a malicious admin could approve
any external contract to get the token that it want. Since the allowance is maximum, a malicious contract could steal as much token as it wants from the contract after the approval.
Consider whitelisting the allowed address and not allow the admin to arbitariry approve any address.
#0 - JTraversa
2022-07-06T18:44:17Z
Duplicate of #44
🌟 Selected for report: Kumpa
Also found by: Metatron, cccz, cryptphi, hansfriese, jah, kenzo, kirk-baird, pashov, poirots
43.9587 USDC - $43.96
Normally the amount of fees after calculateFee
should be added into fees[u]
so that the admin could withdraw it through withdrawFee
. However, illuminate ledning does not track fees[u]
. Therefore, the only way to get fees back is through withdraw
which admin needs to wait at least 3 days before receiving the fees.
Add the amount of fee after each transaction into fees[u]
like other lending method.
for example: fees[u] += calculateFee(a);
🌟 Selected for report: Kumpa
1134.6506 USDC - $1,134.65
https://github.com/code-423n4/2022-06-illuminate/blob/912be2a90ded4a557f121fe565d12ec48d0c4684/lender/Lender.sol#L705-L720 https://github.com/code-423n4/2022-06-illuminate/blob/912be2a90ded4a557f121fe565d12ec48d0c4684/lender/Lender.sol#L659-L675
withdrawFee
of eToken requires the amount of eToken in Lender.sol
>= fees[eToken]
so Safe.transfer
will not revert. However if the admin withdraw(eToken)
first, the balance of eToken in Lender.sol
will equal to zero while fees[eToken]
remains the same and withdrawFee(eToken)
will become unfunctioning since eToken in the contract does not match fees[eToken]
. The admin will need to rely on withdraw
, which takes 3 days before transfering, to get the future fees of eToken.
add fees[eToken] = 0;
after withdrawals[e] = 0;
in withdraw
.
#0 - sourabhmarathe
2022-07-01T20:48:49Z
Appears to be similar to #115 but not exactly the same.
#1 - JTraversa
2022-07-06T18:45:30Z
Yeah id say definitely a separate ticket / reasonable recommended remediation.
#2 - JTraversa
2022-08-05T23:35:56Z
Turns out this one should've been disputed (the only case where the emergency withdraw is called is when we are migrating contracts due to an emergency, meaning the old state actually doesnt matter at all
#3 - JTraversa
2022-08-19T07:39:23Z
As a quick comment in our final review, the inability to use methods on an aborted contract would only matter should you want to reinitialize the same contracts.
Given we would only abort our contracts due to vulnerabilities, there would never be such a scenario.