Althea Liquid Infrastructure - CaeraDenoir's results

Liquid Infrastructure.

General Information

Platform: Code4rena

Start Date: 13/02/2024

Pot Size: $24,500 USDC

Total HM: 5

Participants: 84

Period: 6 days

Judge: 0xA5DF

Id: 331

League: ETH

Althea

Findings Distribution

Researcher Performance

Rank: 17/84

Findings: 2

Award: $267.84

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

25.7286 USDC - $25.73

Labels

bug
2 (Med Risk)
downgraded by judge
satisfactory
duplicate-87

External Links

Lines of code

https://github.com/code-423n4/2024-02-althea-liquid-infrastructure/blob/bd6ee47162368e1999a0a5b8b17b701347cf9a7d/liquid-infrastructure/contracts/LiquidInfrastructureERC20.sol#L222

Vulnerability details

Summary

There is an out of bounds index problem if the distributableERC20s array gets updated and the length increases while a distribution is ongoing.

Description

The setDistributableERC20s function does not check if the LockedForDistribution boolean value. In case a distribution is in progress and the distributableERC20s array increases in length, the distribute function will try to access a erc20EntitlementPerUnit index that is out of bounds.

This is due to the index being determined by the current distributableERC20s array length, while the erc20EntitlementPerUnit length is fixed to the distributableERC20s length when _beginDistribution is called.

Impact

I would consider it's impact to be medium. Even if it could be fixed by reverting the distributableERC20s changes, the distribution could get delayed until an admin comes in to fix it. It could also be triggered intentionally by anyone since the distribute function itself has no access control, so anyone can frontrun the distributableERC20s change to maliciously impact the distribution.

Tools Used

VSCode

The setDistributableERC20s function could have a check to prevent it being called when a distribution is in progress.

Assessed type

Other

#0 - c4-pre-sort

2024-02-20T05:53:22Z

0xRobocop marked the issue as duplicate of #260

#1 - c4-judge

2024-03-04T15:29:30Z

0xA5DF marked the issue as satisfactory

#2 - c4-judge

2024-03-08T15:13:03Z

0xA5DF changed the severity to 3 (High Risk)

#3 - c4-judge

2024-03-08T15:26:19Z

0xA5DF changed the severity to 2 (Med Risk)

Awards

242.1143 USDC - $242.11

Labels

bug
2 (Med Risk)
satisfactory
duplicate-82

External Links

Lines of code

https://github.com/code-423n4/2024-02-althea-liquid-infrastructure/blob/bd6ee47162368e1999a0a5b8b17b701347cf9a7d/liquid-infrastructure/contracts/LiquidInfrastructureERC20.sol#L382

Vulnerability details

Summary

In the LiquidInfrastructureERC20.sol contract theres a flaw that could render the withdrawFromManagedNFTs function useless. This is due to nextWithdrawal being higher than ManagedNFTs.length.

Vulnerability details

The releaseManagedNFTs function does not check that the nextWithdrawal variable is lower or equal to ManagedNFTs.length. If nextWithdrawal ends up being higher than ManagedNFTs.length there is no way to set nextWithdrawal back to zero.

Impact

The impact on the protocol would be medium because even though it is a extremely niche case, it would need an admin action in order to make the contract work again. This is due to the inhability to withdraw the ERC20 tokens from the NFTs until the nextWithdrawal variable is set to zero again.

Tools Used

VSCode

Make the releaseManagedNFTs function reset the nextWithdrawal to zero if the value is higher than the new length of ManagedNFTs.

Assessed type

Other

#0 - c4-pre-sort

2024-02-22T07:41:11Z

0xRobocop marked the issue as duplicate of #130

#1 - c4-judge

2024-03-03T13:04:32Z

0xA5DF marked the issue as satisfactory

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