ParaSpace contest - ksk2345'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: 66/106

Findings: 1

Award: $103.92

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2022-11-paraspace/blob/c6820a279c64a299a783955749fdc977de8f0449/paraspace-core/contracts/protocol/pool/PoolCore.sol#L156

Vulnerability details

Function supplyWithPermit is incompatible with DAI permit interface. This function may work for other stablecoins like USDC, USDT, but users of DAI may be at disadvantage.

Impact

supplyWithPermit() in PoolCore.sol is an external function which can be called directly bypassing UI. In such cases, the user will not be able to supply DAI when using supplyWithPermit() Functionality of supplyWithPermit is broken for DAI due to interface/parameter mismatch.

Proof of Concept

Contract : PoolCore.sol Function : supplyWithPermit This internally calls IERC20WithPermit(asset).permit( msg.sender, address(this), amount, deadline, permitV, permitR, permitS );

Whereas in the DAI contract permit is defined as below

function permit(address holder, address spender, uint256 nonce, uint256 expiry, bool allowed, uint8 v, bytes32 r, bytes32 s) external

ref: https://etherscan.io/address/0x6b175474e89094c44da98b954eedeac495271d0f#code

There is an additional bool field 'allowed' in DAI permit, and also the nonce parameter will be incorrect .

Customise this function supplyWithPermit to handle specifically DAI with other stablecoins. Check for DAI as asset and call permit with different parameter/signature.

#0 - c4-judge

2022-12-20T16:32:14Z

dmvt marked the issue as duplicate of #203

#1 - c4-judge

2023-01-23T12:09:31Z

dmvt marked the issue as not a duplicate

#2 - c4-judge

2023-01-23T12:09:46Z

dmvt changed the severity to QA (Quality Assurance)

#3 - c4-judge

2023-01-25T16:18:22Z

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