Ethena Labs - supersizer0x's results

Enabling The Internet Bond

General Information

Platform: Code4rena

Start Date: 24/10/2023

Pot Size: $36,500 USDC

Total HM: 4

Participants: 147

Period: 6 days

Judge: 0xDjango

Id: 299

League: ETH

Ethena Labs

Findings Distribution

Researcher Performance

Rank: 106/147

Findings: 1

Award: $4.52

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2023-10-ethena/blob/ee67d9b542642c9757a6b826c82d0cae60256509/contracts/StakedUSDeV2.sol#L100

Vulnerability details

Impact

By not checking if the user has cooldown already set int cooldownAssets and cooldownShares we can get out of your exisitng cooldown when a owner sets the cooldown lower.The reason this is an issue is because if some yield that still hasnt provided for the existing cooldown users then the protocol might not be able to service the users who now can unstake earlier.

Proof of Concept

ex:

  1. Alice redeems sUSDE and at t0 cooldownDuation=14 days
  2. Bob the owner sets the cooldownDuration=1 days
  3. Alice redeems 1wei of sUSDE and its cooldown is now only 1 day
  4. Alice now can redeem earlier causing the protocol either not to be able to handle so many unstaking requests or the protocol might give out to much yield or unfair amount of yield.
  if (assets > maxWithdraw(owner)) revert ExcessiveWithdrawAmount();

    uint256 shares = previewWithdraw(assets);

    cooldowns[owner].cooldownEnd = uint104(block.timestamp) + cooldownDuration;
    cooldowns[owner].underlyingAmount += assets;

    _withdraw(_msgSender(), address(silo), owner, assets, shares);

as we can see above their is no check that their is cooldown in progress so an attacker overide their cooldown

Tools Used

require(cooldowns[owner].cooldownEnd!=0)

this below enables that they have to wait even longer

    cooldowns[owner].cooldownEnd = uint104(block.timestamp) + cooldownDuration + cooldowns[owner].cooldownEnd ;

Assessed type

Invalid Validation

#0 - c4-pre-sort

2023-11-01T00:50:32Z

raymondfam marked the issue as sufficient quality report

#1 - c4-pre-sort

2023-11-01T00:50:40Z

raymondfam marked the issue as duplicate of #29

#2 - c4-judge

2023-11-13T19:05:29Z

fatherGoose1 marked the issue as satisfactory

#3 - c4-judge

2023-11-17T02:45:06Z

fatherGoose1 changed the severity to QA (Quality Assurance)

#4 - c4-judge

2023-11-17T16:47:07Z

This previously downgraded issue has been upgraded by fatherGoose1

#5 - c4-judge

2023-11-27T20:00:09Z

fatherGoose1 changed the severity to QA (Quality Assurance)

#6 - c4-judge

2023-11-27T20:01:15Z

fatherGoose1 marked the issue as grade-b

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