ParaSpace contest - Awesome'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: 51/106

Findings: 2

Award: $148.85

QA:
grade-b

🌟 Selected for report: 0

πŸš€ Solo Findings: 0

Awards

44.934 USDC - $44.93

Labels

bug
3 (High Risk)
satisfactory
upgraded by judge
duplicate-402

External Links

Lines of code

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

Vulnerability details

Impact

According to this comment, removeFeeder() is intended to be called only by the owner to remove the feeder.

However, because it is missing the modifier onlyRole() and since removeFeeder() is also external anyone can make a call to removeFeeder() and remove its feeder.

The owner may try to add feeders back by calling addFeeders(), but a malicious user can continuously call removeFeeder() to remove the feeder every time the owner adds the feeder back.

Depending on the price feed information and updates, this can disrupt the protocol on all function calls.

Proof of Concept

misc/NFTFloorOracle.sol#L165-L172

/// @notice Allows owner to remove feeder. /// @param _feeder feeder to remove function removeFeeder(address _feeder) external onlyWhenFeederExisted(_feeder) { _removeFeeder(_feeder); }

As we can see, removeFeeder() does not have an onlyRole() modifier to verify if the person calling is the owner.

Add the modifier onlyRole() to the removeFeeder() function

#1 - c4-judge

2022-12-20T16:58:55Z

dmvt marked the issue as duplicate of #31

#2 - c4-judge

2023-01-09T14:10:54Z

dmvt changed the severity to 3 (High Risk)

#3 - c4-judge

2023-01-23T16:00:33Z

dmvt marked the issue as satisfactory

1. Lines are too long

Usually, lines in source code are limited to 80 characters.

It's advised to keep lines lower than 120 characters.

Today’s screens are much larger so it’s reasonable to stretch this in some cases.

Since the files will most likely reside in GitHub, and GitHub starts using a scroll bar in all cases when the length is over 164 characters, the lines below should be split when they reach that length

There is 1 instance of this issue

2. Typos

File: LiquidationLogic.sol

Line 104: //userDebt from liquadationReserve

File: NFTFloorOracle.sol

Line 53: /// aggeregate prices which are not expired from different feeders, if number of valid/unexpired prices Line 54: /// not enough, we do not aggeregate and just use previous price Line 412: //aggeregate with price from all feeders

SignatureChecker.sol#L14

Line 14: * @param hash the hash containing the signed mesage Line 15: * @param v parameter (27 or 28). This prevents maleability since the public key recovery equation has two possible solutions. Line 43: * @param hash the hash containing the signed mesage Line 48: * @param domainSeparator paramer to prevent signature being executed in other chains and environments

Suggested changes:

  • liquadationReserve => liquidationReserve
  • aggeregate => aggregate
  • mesage => message
  • maleability => malleability
  • paramer => parameter

#0 - c4-judge

2023-01-25T17:04:04Z

dmvt 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