state management vulnerability in Swan.sol creates risks for the asset listing system:
State Manipulation Risk:
The AssetStatus enum using 0 as Unlisted creates ambiguity between new assets and expired listings
Attackers could exploit this to bypass listing restrictions
Impact: Potential market manipulation and broken invariants
Relisting Vulnerability:
The relist function overwrites listings without proper state cleanup
Missing validation of state transitions
Impact: Could lead to assets existing in invalid states, breaking core market functionality
Economic Impact:
Broken state management affects asset trading
Could disrupt fee collection and royalty distributions
Impacts market participants: buyers, sellers and protocol revenue
The combination of these issues creates systemic risk for the Swan protocol's core marketplace functionality.
Swan's asset state management system allows invalid state transitions and breaks core protocol invariants through the relisting mechanism.
The bug is the state management of assets, specifically in the relist()
function. Here's why:
The relist()
function allows an asset to be relisted if it was previously listed but not sold
However, there's no check to ensure the asset's state is properly reset when relisting
This function creates a new listing with AssetStatus.Listed
without first verifying or resetting the previous state
This could lead to a scenario where:
Asset is initially listed (state = 1)
Round passes without sale
Asset is relisted but previous state remains
New listing state is set without clearing old one
Could potentially result in invalid state values
Breaks core invariant: assetStates[asset] <= 2
Disrupts market operations and fee collection
Allows manipulation of asset states
Affects all market participants
Manual Review
Implement a proper state machine with explicit transitions and cleanup mechanisms.
Alternative
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.