Illuminate contest - Picodes'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: 27/88

Findings: 3

Award: $435.11

🌟 Selected for report: 1

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: Picodes

Also found by: Chom, Lambda, auditor0517, cryptphi, csanuragjain, hansfriese, hyh, kenzo, kirk-baird, pashov, unforgiven, zer0dot

Labels

bug
3 (High Risk)
sponsor confirmed

Awards

82.1689 USDC - $82.17

External Links

Lines of code

https://github.com/code-423n4/2022-06-illuminate/blob/912be2a90ded4a557f121fe565d12ec48d0c4684/redeemer/Redeemer.sol#L120

Vulnerability details

Impact

Funds may be stuck when redeeming for Illuminate.

Proof of Concept

Assuming the goal of calling redeem for Illuminate here is to redeem the Illuminate principal held by the lender or the redeemer, then there is an issue because the wrong balance is checked. So if no msg.sender has a positive balance funds will be lost.

Now assuming the goal of calling redeem for Illuminate here is for users to redeem their Illuminate principal and receive the underlying as suggested by this comment, then the underlying is not sent back to users because Safe.transferFrom(IERC20(u), lender, address(this), amount); send the funds to the redeemer, not the user.

Clarify the purpose of this function and fix the corresponding bug.

Findings Information

🌟 Selected for report: shenwilly

Also found by: Chom, Picodes, cccz, datapunk, kenzo, unforgiven

Labels

bug
duplicate
3 (High Risk)

Awards

287.1428 USDC - $287.14

External Links

Lines of code

https://github.com/code-423n4/2022-06-illuminate/blob/912be2a90ded4a557f121fe565d12ec48d0c4684/redeemer/Redeemer.sol#L136

Vulnerability details

Impact

When redeeming from APWine and Tempus here, the principal token is not transferred to the redeemer, so may be stuck on the lender contract.

Proof of Concept

Instead of Safe.transferFrom(IERC20(u), lender, address(this), amount); it should be Safe.transferFrom(IERC20(principal), lender, address(this), amount);

#0 - KenzoAgada

2022-06-28T14:03:01Z

Duplicate of #268

[NC - 01] - Readability could be improved when taking max value of a type

Here, since Solidity 0.8.8, you can use type(uint256).max.

Check https://github.com/ethereum/solidity/blob/develop/Changelog.md#088-2021-09-27

[NC - 02] - Typo

Here, avaialable -> available

[NC - 03] - Typo

Here, prinicipal -> principal

[NC - 04] - Use readable variable names

The code interact with various protocols and is already quite complicated, no need to obfuscate it with unreadable variable names such as u, n, m,

[L - 01] - Redeem does not behave as explained in the comments

https://github.com/code-423n4/2022-06-illuminate/blob/912be2a90ded4a557f121fe565d12ec48d0c4684/redeemer/Redeemer.sol#L128

When redeeming Illuminate's token, the underlying is not sent back to the user, like said in the previous comment. So reading this function code is misleading and may lead to a user calling it.

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