Ethena Labs - kkkmmmsk'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: 107/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/StakedUSDe.sol#L225-L238

Vulnerability details

Impact

If one person left 1wei in StakedUSDe, and the last withdrawal cannot be fully withdrawn.

Proof of Concept

For example, stakerA left 1 wei share in StakedUSDe, and after the last withdrawal totalSupply=1 wei,

it will revert MinSharesViolation, and last withdrawal fails. So the last withdrawal must left 1 ether

share in StakedUSDe contract, and can not withdraw all shares.

function _withdraw(address caller, address receiver, address _owner, uint256 assets, uint256 shares) internal override nonReentrant notZero(assets) notZero(shares) { if (hasRole(FULL_RESTRICTED_STAKER_ROLE, caller) || hasRole(FULL_RESTRICTED_STAKER_ROLE, receiver)) { revert OperationNotAllowed(); } super._withdraw(caller, receiver, _owner, assets, shares); _checkMinShares(); } function _checkMinShares() internal view { uint256 _totalSupply = totalSupply(); if (_totalSupply > 0 && _totalSupply < MIN_SHARES) revert MinSharesViolation(); }

Tools Used

Manual Review

remove _checkMinShares in _withdraw function

Assessed type

ERC4626

#0 - c4-pre-sort

2023-10-31T19:16:16Z

raymondfam marked the issue as sufficient quality report

#1 - c4-pre-sort

2023-10-31T19:16:27Z

raymondfam marked the issue as duplicate of #71

#2 - c4-judge

2023-11-13T20:24:44Z

fatherGoose1 marked the issue as satisfactory

#3 - c4-judge

2023-11-17T16:56:01Z

fatherGoose1 changed the severity to QA (Quality Assurance)

#4 - c4-judge

2023-11-27T20:49:04Z

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