ParaSpace contest - seyni'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: 98/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)
satisfactory
duplicate-420

External Links

Lines of code

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

Vulnerability details

Impact

ParaSpaceOracle uses latestAnswer in getAssetPrice. The documentation state that source could be "chainlink or other sources".

The price could be fine if it has already been validated by a source and then retrieved using source.latestAnswer(). But, if source is chainlink for which latestAnswer is deprecated it might lead to this issues:

  • Deprecated API stops working.
  • Price could not be obtained silently because the function doesn't revert but return 0 on failure.

This would lead for the protocol to stop operating and needing to be redeployed.

Proof of Concept

https://docs.chain.link/data-feeds/price-feeds/api-reference#accesscontrolledoffchainaggregator

ParaSpaceOracle.sol#L128

            price = uint256(source.latestAnswer());

Tools Used

Manual review.

I recommend using latestRoundData instead of latestAnswer with added checks of price freshness.

#0 - c4-judge

2022-12-20T17:44:20Z

dmvt marked the issue as duplicate of #5

#1 - c4-judge

2023-01-23T15:17:32Z

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