Stader Labs - etherhood's results

Decentralized ETH liquid staking protocol with 4 ETH bond for anyone to be a node operator.

General Information

Platform: Code4rena

Start Date: 02/06/2023

Pot Size: $100,000 USDC

Total HM: 15

Participants: 75

Period: 7 days

Judge: Picodes

Total Solo HM: 5

Id: 249

League: ETH

Stader Labs

Findings Distribution

Researcher Performance

Rank: 4/75

Findings: 3

Award: $6,173.12

Gas:
grade-b

🌟 Selected for report: 1

🚀 Solo Findings: 1

Findings Information

🌟 Selected for report: etherhood

Labels

bug
2 (Med Risk)
satisfactory
selected for report
sponsor confirmed
M-08

Awards

6119.6969 USDC - $6,119.70

External Links

Lines of code

https://github.com/code-423n4/2023-06-stader/blob/main/contracts/StaderOracle.sol#L270 https://github.com/code-423n4/2023-06-stader/blob/main/contracts/StaderOracle.sol#L285

Vulnerability details

Impact

Corruption of oracle data

Proof of Concept

Block for lastReportedSDPriceData = 7200 Let current block = 21601 Now StaderOracle will have data for 14400 and 21600 both blocks being pushed by nodes and in prices array it will be all mixed up. Also, As soon as 14400 block is finalised data for block 21600 is all lost as well.

Tools Used

add if (_sdPriceData.reportingBlockNumber == getSDPriceReportableBlock()) to ensure it is always latest reportable block data add mapping(uint256 => uint256[]) blockPrices to store prices array separately for each block being reported to avoid mixing and corruption of data or have uint256 currentEpochBlock so that when new block data is pushed, previous data is deleting before pushing new data

if(_sdPriceData.reportingBlockNumber!=currentEpochBlock){ delete prices; } ## Assessed type Oracle

#0 - manoj9april

2023-06-20T06:58:58Z

Sure we will fix this.

#1 - c4-sponsor

2023-06-20T06:59:07Z

manoj9april marked the issue as sponsor confirmed

#2 - c4-judge

2023-07-02T10:44:13Z

Picodes marked the issue as satisfactory

#3 - sanjay-staderlabs

2023-07-13T04:19:45Z

This is fixed

Awards

31.7954 USDC - $31.80

Labels

bug
2 (Med Risk)
satisfactory
duplicate-15

External Links

Lines of code

https://github.com/code-423n4/2023-06-stader/blob/main/contracts/StaderOracle.sol#L637

Vulnerability details

Impact

Stale data of exchange rate data being used protocol, resulting in loss in terms of ETHX being minted at stale exchange rate (which won't have accounted for new reward)

Check lastUpdatedAt timestamp and that it is within acceptable range of data update frequency when PORFeed is being used

Assessed type

Other

#0 - c4-judge

2023-06-10T14:44:55Z

Picodes marked the issue as duplicate of #15

#1 - c4-judge

2023-07-02T10:49:25Z

Picodes marked the issue as satisfactory

Awards

21.6219 USDC - $21.62

Labels

bug
G (Gas Optimization)
grade-b
G-12

External Links

#0 - c4-judge

2023-06-14T05:35:20Z

Picodes 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