Open code423n4 opened 1 year ago
hansfriese marked the issue as satisfactory
PoC -> Marked as primary
hansfriese marked the issue as primary issue
wukong-particle marked the issue as sponsor confirmed
hansfriese marked the issue as selected for report
Lines of code
https://github.com/code-423n4/2023-05-particle/blob/1caf678bc20c24c96fc8f6b0046383ff0e9d2a6f/contracts/protocol/ParticleExchange.sol#L428
Vulnerability details
Impact
Use other Lien's NFTs for repayment
Proof of Concept
_execBuyNftFromMarket()
Whether the NFT is in the current contract after buy, to represent the successful buy of NFTBut before executing the purchase, it does not determine whether the NFT is already in the contract
Since the current protocol does not limit an NFT to only one Lien, the
_execBuyNftFromMarket()
does not actually buy NFT, the funds is used to buy other NFTs but still can meet the verification conditionsExample.
sellNftToMarket(1)
, and NFT_A is bought by jackIERC721(collection).ownerOf(tokenId) ! = address(this) || balanceBefore - address(this).balance ! = amount
and bob gets an additional NFT_KTest code:
Tools Used
Recommended Mitigation Steps
_execBuyNftFromMarket
to determine the ownerOf() is not equal to the contract address before buyingAssessed type
Context