ParaSpace contest - Big0XDev'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: 40/106

Findings: 1

Award: $342.95

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: 0x52

Also found by: Big0XDev, Dravee, KingNFT, c7e7eff, cccz, xiaoming90

Labels

bug
3 (High Risk)
partial-50
duplicate-137

Awards

342.9511 USDC - $342.95

External Links

Lines of code

https://github.com/code-423n4/2022-11-paraspace/blob/main/paraspace-core/contracts/ui/WPunkGateway.sol#L77

Vulnerability details

Impact

In order to supply a PUNK, PUNK owner has to offer their PUNK for sale to the WPunkGateway with 0ETH and then call supplyPunk. during this time, anyone can call supplyPunk which will supply the PUNK to ParaSpace as collateral for the exploiter.

Proof of Concept

1- PUNK owner calls offerPunkForSale on their PUNK 2- Exploiter front-run the PUNK owner and calls supplyPunk 3- PUNK will be deposited to WPUNK and WPUNK token will be sent to the exploiter at the beginning of the TX. 4- supplyERC721 which will supply the PUNK to ParaSpace as collateral for the exploiter.

Tools Used

Manual review

Add a check to see if the msg.sender is the owner of the punk:

function supplyPunk( DataTypes.ERC721SupplyParams[] calldata punkIndexes, address onBehalfOf, uint16 referralCode ) external nonReentrant { for (uint256 i = 0; i < punkIndexes.length; i++) { require(Punk.punkIndexToAddress(punkIndexes[i].tokenId) == msg.sender); Punk.buyPunk(punkIndexes[i].tokenId); Punk.transferPunk(proxy, punkIndexes[i].tokenId); // gatewayProxy is the sender of this function, not the original gateway WPunk.mint(punkIndexes[i].tokenId); } Pool.supplyERC721( address(WPunk), punkIndexes, onBehalfOf, referralCode ); }

#0 - c4-judge

2022-12-20T18:11:17Z

dmvt marked the issue as duplicate of #71

#1 - c4-judge

2023-01-09T16:50:34Z

dmvt marked the issue as nullified

#2 - c4-judge

2023-01-23T20:02:47Z

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