Illuminate contest - Kumpa's results

Your Sole Source For Fixed-Yields.

General Information

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

Illuminate

Findings Distribution

Researcher Performance

Rank: 13/88

Findings: 4

Award: $1,262.76

🌟 Selected for report: 2

🚀 Solo Findings: 1

Findings Information

Awards

29.8781 USDC - $29.88

Labels

bug
duplicate
3 (High Risk)

External Links

Lines of code

https://github.com/code-423n4/2022-06-illuminate/blob/912be2a90ded4a557f121fe565d12ec48d0c4684/lender/Lender.sol#L545-L589

Vulnerability details

Impact

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

Proof of Concept

  1. Attacker creates fake aave contract with function named deposit that receives underlying token from the Lender.sol and later send it to attacker

  2. Attacker creates fake pool contract with function named swapExactAmountIn that does not perform any swap but returns any number that the attacker wants

  3. Attacker inputs those addresses in the lend to perform an attack

  4. 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

  5. fake pool returns any amount of principalToken that the attacker wants

Mitigations

Implementing require to check the eligibility of the external contract before calling

#0 - sourabhmarathe

2022-06-29T12:42:35Z

Duplicate of #349.

Findings Information

🌟 Selected for report: kirk-baird

Also found by: 0xDjango, GalloDaSballo, Kumpa, kenzo, pashov, shenwilly, tintin, unforgiven

Labels

bug
duplicate
2 (Med Risk)
sponsor disputed

Awards

54.27 USDC - $54.27

External Links

Lines of code

https://github.com/code-423n4/2022-06-illuminate/blob/912be2a90ded4a557f121fe565d12ec48d0c4684/lender/Lender.sol#L102-L124

Vulnerability details

Impact

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.

Proof of Concept

Pic 2 0

Mitigations

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

Findings Information

🌟 Selected for report: Kumpa

Also found by: Metatron, cccz, cryptphi, hansfriese, jah, kenzo, kirk-baird, pashov, poirots

Labels

bug
2 (Med Risk)
sponsor confirmed

Awards

43.9587 USDC - $43.96

External Links

Lines of code

https://github.com/code-423n4/2022-06-illuminate/blob/912be2a90ded4a557f121fe565d12ec48d0c4684/lender/Lender.sol#L185-L235

Vulnerability details

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.

Mitigations

Add the amount of fee after each transaction into fees[u] like other lending method.
for example: fees[u] += calculateFee(a);

Findings Information

🌟 Selected for report: Kumpa

Labels

bug
2 (Med Risk)
sponsor confirmed

Awards

1134.6506 USDC - $1,134.65

External Links

Lines of code

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

Vulnerability details

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.

Mitigations

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.

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter