ParaSpace contest - hansfriese'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: 91/106

Findings: 2

Award: $54.08

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

44.934 USDC - $44.93

Labels

bug
3 (High Risk)
satisfactory
duplicate-402

External Links

Lines of code

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

Vulnerability details

Impact

There is no onlyRole modifier in removeFeeder, so anyone can remove feeders from NFTFloorOracle, and it will cause a DOS attack.

Proof of Concept

    function removeFeeder(address _feeder)
        external
        onlyWhenFeederExisted(_feeder) //@audit no modifier
    {
        _removeFeeder(_feeder);
    }

There is onlyRole modifier in addFeeders, so only default admin can add feeders. But there is no onlyRole modifier in removeFeeder, so anyone can remove feeders from NFTFloorOracle. If the number of feeders are less than MIN_ORACLES_NUM, _combine will return false for dataValidity, and we can't set price using _finalizePrice in setPrice. So it can induce a DOS attack.

Tools Used

Manual Review

Add onlyRole modifier in removeFeeder.

#0 - c4-judge

2022-12-20T16:59:15Z

dmvt marked the issue as duplicate of #31

#1 - c4-judge

2023-01-23T15:59:55Z

dmvt marked the issue as satisfactory

Findings Information

Awards

9.1532 USDC - $9.15

Labels

bug
2 (Med Risk)
partial-50
edited-by-warden
duplicate-420

External Links

Lines of code

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

Vulnerability details

Impact

When we get asset price from ParaSpaceOracle.getAssetPrice, it can return stale price due to an error.

Proof of Concept

        if (address(source) != address(0)) {
            price = uint256(source.latestAnswer()); //@audit wrong conversion
        }
        if (price == 0 && address(_fallbackOracle) != address(0)) {
            price = _fallbackOracle.getAssetPrice(asset);
        }

When source.latestAnswer returns negative value for stale price, price will be positive after it is converted to uint256. So we can't try fallback oracle in the next if statement, and ParaSpaceOracle.getAssetPrice will return stale price.

Tools Used

Manual Review

Check price before it is converted to uint256.

#1 - JeffCX

2022-12-18T03:33:44Z

The warden not only talks about the stale price of the latestAnswer, but also talks about the casting issue.

I believe in the case of the token price, it is very unlikely the token price will be negative.

the casting issue part duplicates https://github.com/code-423n4/2022-11-paraspace-findings/issues/48

#2 - c4-judge

2022-12-20T17:45:59Z

dmvt marked the issue as duplicate of #5

#3 - c4-judge

2023-01-23T15:50:55Z

dmvt marked the issue as partial-50

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