Alchemix contest - CertoraInc's results

A protocol for self-repaying loans with no liquidation risk.

General Information

Platform: Code4rena

Start Date: 05/05/2022

Pot Size: $125,000 DAI

Total HM: 17

Participants: 62

Period: 14 days

Judge: leastwood

Total Solo HM: 15

Id: 120

League: ETH

Alchemix

Findings Distribution

Researcher Performance

Rank: 10/62

Findings: 1

Award: $6,389.44

🌟 Selected for report: 1

🚀 Solo Findings: 1

Findings Information

🌟 Selected for report: CertoraInc

Labels

bug
2 (Med Risk)
sponsor confirmed

Awards

6389.4401 DAI - $6,389.44

External Links

Lines of code

https://github.com/code-423n4/2022-05-alchemix/blob/de65c34c7b6e4e94662bf508e214dcbf327984f4/contracts-full/adapters/fuse/FuseTokenAdapterV1.sol#L76 https://github.com/code-423n4/2022-05-alchemix/blob/de65c34c7b6e4e94662bf508e214dcbf327984f4/contracts-full/adapters/fuse/FuseTokenAdapterV1.sol#L98

Vulnerability details

Impact

the code is doing wrong check, so when things will work it will revert.

Proof of Concept

In the function wrap() there is this lines:

if ((error = ICERC20(token).mint(amount)) != NO_ERROR) { revert FuseError(error); }

but mint returns the amount that minted, so when error = amount the check will fail even though it worked good.

Same in unwrap:

if ((error = ICERC20(token).redeem(amount)) != NO_ERROR) { revert FuseError(error); }

the redeem returns the amount.

I recommend to change the lines like this: in wrap: if ((error = ICERC20(token).mint(amount)) != amount) { revert FuseError(error); } and in unwrap: if ((error = ICERC20(token).redeem(amount)) != amount) { revert FuseError(error); }

#0 - 0xfoobar

2022-05-22T21:31:04Z

Sponsor confirmed.

This would not cause any loss of user funds because the deposit function would revert, but it is a needed fix in the Fuse Adapter. So recommend a lower severity.

#1 - 0xleastwood

2022-06-03T17:23:53Z

As no assets are at risk, medium risk seems correct because only the availability of the protocol is impacted.

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