Dria

Swan
NFTHardhat
21,000 USDC
View results
Submission Details
Severity: medium
Invalid

After transfer nft(asset) to other address, new owner could not relist asset, but old owner - could

Summary

User could transfer asset to other address (sell on the secondary market, for example), but he still can relist asset and new owner could not do it.

Vulnerability Details

When user transfer nft with id 1(asset) to other address, there is changing only in asset contract.

When new owner will try to relist asset, he could not do it, because relist() function check that msg.sender is equal address from mapping `listings[asset]`, but not current owner of nft with id 1.

function relist(address _asset, address _buyer, uint256 _price) external {
AssetListing storage asset = listings[_asset];
// only the seller can relist the asset
if (asset.seller != msg.sender) {
revert Unauthorized(msg.sender);
}
...
}

Impact

New owner of asset could call relist() asset.

Tools Used

Manual review

Recommendations

function relist(address _asset, address _buyer, uint256 _price) external {
AssetListing storage asset = listings[_asset];
// only the seller can relist the asset
- if (asset.seller != msg.sender) {
+ if (SwanAsset(_asset).ownerOf(1) == msg.sender) {
revert Unauthorized(msg.sender);
}
...
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 12 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Appeal created

sovaslava Submitter
12 months ago
inallhonesty Lead Judge
12 months ago
inallhonesty Lead Judge 12 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.