Asymmetry contest - Parad0x's results

A protocol to help diversify and decentralize liquid staking derivatives.

General Information

Platform: Code4rena

Start Date: 24/03/2023

Pot Size: $49,200 USDC

Total HM: 20

Participants: 246

Period: 6 days

Judge: Picodes

Total Solo HM: 1

Id: 226

League: ETH

Asymmetry Finance

Findings Distribution

Researcher Performance

Rank: 73/246

Findings: 2

Award: $70.11

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

29.4683 USDC - $29.47

Labels

bug
3 (High Risk)
low quality report
partial-50
upgraded by judge
duplicate-703

External Links

Lines of code

https://github.com/code-423n4/2023-03-asymmetry/blob/44b5cd94ebedc187a08884a7f685e950e987261c/contracts/SafEth/SafEth.sol#L182-L195

Vulnerability details

Impact

On incorrect input of derivative contract, most of the other functions will fail and then the user funds will be lost.

Proof of Concept

A. The administrator plans to utilize the addDerivative function to introduce a novel derivative. B. Despite intending to use a specific contract address, the administrator mistakenly types a different one. C. As a result, a derivative with an incorrect contract address is created. D. Subsequently, when attempting to modify the weights via the rebalanceToWeights function, the administrator is unsuccessful because the balance of this incorrect derivative is nonexistent. E. Similarly, users cannot carry out stake and unstake actions for the same fundamental reason.

Tools Used

Manual Review.

The admin should be able to remove a derivate.

#0 - c4-pre-sort

2023-04-02T16:41:42Z

0xSorryNotSorry marked the issue as low quality report

#1 - c4-pre-sort

2023-04-04T17:31:51Z

0xSorryNotSorry marked the issue as duplicate of #703

#2 - c4-judge

2023-04-21T15:06:29Z

Picodes marked the issue as satisfactory

#3 - Picodes

2023-04-24T19:35:33Z

Partial credit for the report's quality

#4 - c4-judge

2023-04-24T19:35:37Z

Picodes marked the issue as partial-50

#5 - c4-judge

2023-04-24T19:36:09Z

Picodes changed the severity to 3 (High Risk)

Findings Information

Labels

bug
2 (Med Risk)
low quality report
satisfactory
duplicate-150

Awards

40.6368 USDC - $40.64

External Links

Lines of code

https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L63-L101

Vulnerability details

Impact

The value of mintAmount is determined by two factors, namely the totalStakeValueEth and preDepositPrice. The totalStakeValueEth is related to external interactions that are beyond the control of individual users. On the other hand, the preDepositPrice can be adjusted to encourage more staker participation by introducing a slippage control mechanism.

In other words, mintAmount, which is the amount of tokens that can be minted, is dependent on two variables: totalStakeValueEth and preDepositPrice. While the former is influenced by external factors that cannot be controlled by individual users, the latter can be adjusted to encourage more people to participate in staking. This can be achieved by implementing a slippage control mechanism, which would ensure that the preDepositPrice is kept at an optimal level to incentivize more staker participation. By doing so, the platform can attract more users and improve overall engagement, leading to increased adoption and success.

Proof of Concept

The purpose of the ethPerDerivative() is to obtain the price of each derivative in terms of ETH. Although it is assumed that the prices would remain closely or stably pegged at a 1:1 ratio, there is no guarantee that there won't be any degree of volatility.

In the case of underlyingValue is less than the totalSupply, the preDepositPrice will be smaller, resulting in a larger mintAmount or the opposite.

As a result, two stakers who call the stake() function with the same amount of ETH but at different time, could end up being minted different amounts of stake ERC20 tokens due to the changing preDepositPrice.

In other words, the ethPerDerivative() function plays a crucial role in determining the price of each derivative in terms of ETH. However, despite the assumption that prices will remain stable, the recent depeg of the USDC has shown that there is a risk of volatility. Additionally, the preDepositPrice, which affects the mintAmount, is inversely related to the underlyingValue and the totalSupply. Thus, any slight price movement can have a significant impact on stake calculations, leading to different minted amounts of stake ERC20 tokens for stakers who call the stake() function at different times. Therefore, it is important to consider these factors when using the platform to ensure fair and accurate token minting.

Tools Used

Manual review.

Function should consider range of slippage approved by the user

#0 - c4-pre-sort

2023-04-02T12:35:35Z

0xSorryNotSorry marked the issue as low quality report

#1 - c4-pre-sort

2023-04-04T21:07:45Z

0xSorryNotSorry marked the issue as primary issue

#2 - c4-pre-sort

2023-04-04T21:08:15Z

0xSorryNotSorry marked the issue as duplicate of #849

#3 - c4-judge

2023-04-24T20:55:30Z

Picodes marked the issue as duplicate of #150

#4 - c4-judge

2023-04-24T20:55:52Z

Picodes 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