Ethena Labs - ziyou-'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: 121/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#L95-L106 https://github.com/code-423n4/2023-10-ethena/blob/ee67d9b542642c9757a6b826c82d0cae60256509/contracts/StakedUSDeV2.sol#L111-L122

Vulnerability details

Impact

Due to improper invocation of the cooldownAssets function and cooldownShares function, previously cooled assets are being re-cooled.

Proof of Concept

Here are the translations of the two scenarios:

(1) When users invoke the cooldownAssets function and cooldownShares function but fail to promptly call the unstake function to withdraw their assets, the assets will be re-cooled.

(2) When users invoke the cooldownAssets function and cooldownShares function, if there are existing assets in the cooldown period, the previous cooldown time will be invalidated. Regardless of whether they are old or new assets, the latest cooldown deadline will be considered.

function cooldownShares(uint256 shares, address owner) external ensureCooldownOn returns (uint256) { if (shares > maxRedeem(owner)) revert ExcessiveRedeemAmount();

uint256 assets = previewRedeem(shares);

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

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

}

function cooldownAssets(uint256 assets, address owner) external ensureCooldownOn returns (uint256) { 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); return shares;

}

Tools Used

vs

Make appropriate modifications to the problem

Assessed type

Context

#0 - c4-pre-sort

2023-10-31T16:56:55Z

raymondfam marked the issue as sufficient quality report

#1 - c4-pre-sort

2023-10-31T16:57:05Z

raymondfam marked the issue as duplicate of #4

#2 - c4-pre-sort

2023-11-01T19:36:47Z

raymondfam marked the issue as duplicate of #514

#3 - c4-judge

2023-11-10T21:26:57Z

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:20:21Z

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