Asymmetry contest - sashik_eth'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: 229/246

Findings: 1

Award: $3.49

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

3.4908 USDC - $3.49

Labels

bug
3 (High Risk)
low quality report
satisfactory
duplicate-1098

External Links

Lines of code

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

Vulnerability details

Impact

First staker can inflate the rate of minting SafEth token per deposited ETH, leading to the loss of next stakers funds.

It's a well-known attack vector, explained for example here.

Proof of Concept

Next scenario possible:

  1. Attacker stake 1 wei of ETH on newly deployed SafETH.sol contract, minting 1 wei of SafETH token.
  2. Attacker sends 1 WST_ETH token to WstETH derivative address.
  3. Next user stake 0.5 ETH, but since the current underlyingValue is 1 ETH (from WST_ETH sent by the attacker) and totalSupply of SafETH is 1 wei - preDepositPrice is overinflated and user mints 0 wei of SafETH, while the attacker could withdraw all staked 1.5 ETH.

Consider adding a restriction to mint more than 0 wei of SafETH token on stake() function call or sending the first 1000 wei of token to a zero address.

#0 - c4-pre-sort

2023-03-31T18:12:01Z

0xSorryNotSorry marked the issue as low quality report

#1 - c4-pre-sort

2023-04-04T12:44:39Z

0xSorryNotSorry marked the issue as duplicate of #715

#2 - c4-judge

2023-04-21T14:56:24Z

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