ParaSpace contest - skinz's results

The First Ever Cross-Margin NFT Financialization Protocol.

General Information

Platform: Code4rena

Start Date: 28/11/2022

Pot Size: $192,500 USDC

Total HM: 33

Participants: 106

Period: 11 days

Judge: LSDan

Total Solo HM: 15

Id: 186

League: ETH

ParaSpace

Findings Distribution

Researcher Performance

Rank: 100/106

Findings: 1

Award: $18.31

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Awards

18.3064 USDC - $18.31

Labels

bug
2 (Med Risk)
partial-50
duplicate-420

External Links

Lines of code

https://github.com/code-423n4/2022-11-paraspace/blob/main/paraspace-core/contracts/misc/ParaSpaceOracle.sol#L130

Vulnerability details

Price can be old and can lead to wrong answer return value.

Proof of Concept

Oracle data feed is insufficiently validated. There is no check for stale price and round completeness. Price can be stale and can lead to wrong answer return value. Buy with a newer price on another platform, use oracle’s stale price for arbitrage.

Check for roundId and timestamp to validate data. Include in if loop if fallbackOracle is preferred solution for stale price. Alternatively, put extra require checks at the end of the function. price = uint256(source.latestRoundData();

require(answer != 0, Errors.ORACLE_PRICE_NOT_READY); require(answeredInRound >= roundID, "ChainLink: Stale price"); require(timestamp > 0, "ChainLink: Round not complete");

Refer to https://docs.chain.link/docs/price-feeds-api-reference/

#0 - c4-judge

2022-12-20T17:45:40Z

dmvt marked the issue as duplicate of #5

#1 - c4-judge

2023-01-09T16:39:07Z

dmvt marked the issue as partial-50

Findings Information

Awards

18.3064 USDC - $18.31

Labels

bug
2 (Med Risk)
satisfactory
duplicate-420

External Links

Lines of code

https://github.com/code-423n4/2022-11-paraspace/blob/main/paraspace-core/contracts/misc/ParaSpaceOracle.sol#L128

Vulnerability details

According to Chainlink’s documentation, the latestAnswer function is deprecated. This function might suddenly stop working if Chainlink stops supporting deprecated APIs. And the old API can return stale data.

Proof of Concept

ParaSpaceOracle.sol#L128. UiIncentiveDataProvider.sol#L118, L179, L275, L342. UiPoolDataProvider.sol#L221, L232, L245.

Use the latestRoundData function to get the price instead. Add checks on the return data with proper revert messages if the price is stale or the round is incomplete. https://docs.chain.link/docs/price-feeds-api-reference/

#1 - c4-judge

2022-12-20T17:45:54Z

dmvt marked the issue as duplicate of #5

#2 - c4-judge

2023-01-09T16:39:30Z

dmvt marked the issue as partial-50

#3 - c4-judge

2023-01-23T15:51:58Z

dmvt marked the issue as satisfactory

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