Ethena Labs - almurhasan'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: 130/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/main/contracts/StakedUSDeV2.sol#L126

Vulnerability details

Proof of Concept

System properties are broken when Cooldown duration is changed during an ongoing cooldownduration period and users call multiple times the function cooldownShares/cooldownAssets before unstaking the previous stUSDe . Let’s take a example,

  1. Let assume alice has 100 stUSDe in StakedUSDeV2 contract.
  2. Currently cooldownduration is 20 days.
  3. Alice wants to withdraw 50 stUSDe .
  4. Alice calls the function cooldownAssets with 50 as asset input and owner as himself.
  5. So state variable is updated as cooldowns[alice].cooldownEnd = 20 days. cooldowns[alice].underlyingAmount = 50.
  6. Now DEFAULT_ADMIN_ROLE changes the cooldownduration to 90 days. 7.Before unstaking the previous 50 stUSDe, alice again calls function cooldownAssets with 25 as asset input amount to withdraw 25 stUSDe. Now alice state variable is updated as cooldowns[alice].cooldownEnd = 90 days And cooldowns[alice].underlyingAmount = 75.

Impact

User have to wait longer than expected to unstake his stUSDe.

Tools Used

manual review

Enable setting a new value for cooldownduration only if there’s no active cooldown and validate that users can’t call cooldownShares/cooldownAssets before unstaking the previous stUSDe or define every cooldown withdrawal differently of a user.

Assessed type

Invalid Validation

#0 - c4-pre-sort

2023-10-31T05:32:56Z

raymondfam marked the issue as sufficient quality report

#1 - c4-pre-sort

2023-10-31T05:33:07Z

raymondfam marked the issue as duplicate of #4

#2 - c4-pre-sort

2023-11-01T19:36:38Z

raymondfam marked the issue as duplicate of #514

#3 - c4-judge

2023-11-10T21:26:59Z

fatherGoose1 marked the issue as unsatisfactory: Invalid

#4 - c4-judge

2023-11-17T17:04:09Z

fatherGoose1 changed the severity to QA (Quality Assurance)

#5 - c4-judge

2023-11-20T20:19:41Z

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