Illuminate contest - GimelSec'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: 34/88

Findings: 3

Award: $240.35

🌟 Selected for report: 0

πŸš€ Solo Findings: 0

Findings Information

🌟 Selected for report: kenzo

Also found by: 0x29A, GimelSec, Lambda, StErMi, cccz, csanuragjain, kirk-baird, sashik_eth, shenwilly

Labels

bug
duplicate
3 (High Risk)

Awards

146.529 USDC - $146.53

External Links

Lines of code

https://github.com/code-423n4/2022-06-illuminate/blob/main/marketplace/ERC5095.sol#L100 https://github.com/code-423n4/2022-06-illuminate/blob/main/marketplace/ERC5095.sol#L116

Vulnerability details

Impact

It doesn't spend _allowance in marketplace/ERC5095.sol. Attackers can call withdraw, redeem multiple times as the holder.

Proof of Concept

In withdraw, redeem of ERC5095.sol check the _allowance:

require(_allowance[holder][msg.sender] >= underlyingAmount, 'not enough approvals');

But in authRedeem it just burns tokens and it doesn't spend _allowance. If Alice approves Bob 100 amounts, Bob can spend 100 amounts again and again to call withdraw and redeem.

Tools Used

None

Spend _allowance:

_setAllowance(owner, spender, currentAllowance - amount);

#0 - KenzoAgada

2022-06-28T06:28:38Z

Duplicate of #245

Findings Information

Awards

29.8781 USDC - $29.88

Labels

bug
duplicate
3 (High Risk)
sponsor confirmed

External Links

Lines of code

https://github.com/code-423n4/2022-06-illuminate/blob/main/lender/Lender.sol#L205

Vulnerability details

Impact

In lend, the y is fully controlled by users. Attackers can steal users' tokens if an attacker gives malicious y to users.

Proof of Concept

  • Alice (attacker) creates a malicious yield pool y and gives it to Bob (victim).
  • Bob calls lend of L192 with malicious y, y can easily craft values to bypass the checks in lend.
  • In L219 or L229, the yield function will transfer token to y (L651): Safe.transfer(IERC20(u), y, a);

Moreover, Alice can trigger reentrancy attacks to call lend again in y (e.g. yield call IYield(y).sellBase(r, returned); to reenter lend). If Bob just set a little a (e.g. 20 amount) of lend, but Bob is very trust Illuminate and set approve max to Illuminate protocol, Alice can trigger reentrancy attack to cal lend multiple times, and amplify total amount to x10 even x100 times.

Tools Used

None

Check yield addresses should be official, or use allowlist to prevent malicious yields.

#0 - sourabhmarathe

2022-06-29T12:35:53Z

Duplicate of #349.

Awards

63.9425 USDC - $63.94

Labels

bug
disagree with severity
QA (Quality Assurance)
sponsor disputed

External Links

Lines of code

https://github.com/code-423n4/2022-06-illuminate/blob/main/lender/Lender.sol#L687

Vulnerability details

Impact

scheduleWithdrawal should have a timeout. Admin can call scheduleWithdrawal in the beginning to bypass time lock.

Proof of Concept

In scheduleWithdrawal, it will set block.timestamp + HOLD;. But admin can call withdraw anytime by calling scheduleWithdrawal in the beginning to bypass timelock.

Tools Used

None

scheduleWithdrawal should have a timeout:

function scheduleWithdrawal(address e) external authorized(admin) returns (bool) { uint256 when = block.timestamp + HOLD; withdrawals[e] = when; timeout[e] = when + TIMEOUT; emit ScheduleWithdrawal(e, when); return true; } function blockWithdrawal(address e) external authorized(admin) returns (bool) { withdrawals[e] = 0; timeout[e] = 0; emit BlockWithdrawal(e); return true; } function withdraw(address e) external authorized(admin) returns (bool) { uint256 when = withdrawals[e]; require (when != 0, 'no withdrawal scheduled'); require (block.timestamp >= when, 'withdrawal still on hold'); require (block.timestamp < timeout[e], 'timeout'); withdrawals[e] = 0; timeout[e] = 0; IERC20 token = IERC20(e); Safe.transfer(token, admin, token.balanceOf(address(this))); return true; }

#0 - sourabhmarathe

2022-06-30T00:15:12Z

This mitigation does not work well in the event that the admin is malicious. In such a scenario, the HOLD value would not matter, as the admin would be able to withdraw funds regardless. As a result, this issue is not considered a critical issue.

#1 - JTraversa

2022-07-06T23:48:29Z

To clarify, the continued lack of a withdrawal after queing one would indicate that the admins may be being malicious. That said, the blockWithdrawal method generally covers this use case, but the suggestion might be a decent QA one? Unsure.

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