A malicious seller can list multiple assets at 1 wei price, effectively blocking legitimate listings due to the maxAssetCount limit while paying zero fees due to rounding down in integer division. This results in denial of service for legitimate sellers and loss of revenue for the protocol and buyer agents. The attack is particularly possible as the protocol is intended to be deployed on Base L2, where gas costs are significantly lower than mainnet.
The protocol calculates fees as percentages using integer division:
When listing an asset there is no minimum price check, allowing a seller to list assets at 1 wei price:
https://github.com/Cyfrin/2024-10-swan-dria/blob/c8686b199daadcef3161980022e12b66a5304f8e/contracts/swan/Swan.sol#L157-L191
HIGH - Multiple severe impacts:
Denial of service for legitimate sellers by exhausting maxAssetCount
Loss of protocol fees (driaFee = 0)
Loss of buyer agent fees (buyerFee = 0)
Minimal cost to attacker (only gas fees)
Blocks protocol's economic model
Attack is highly economical on Base L2:
Gas costs are significantly lower than mainnet
Attacker can spam dust listings very cheaply
Multiple rounds of DoS are cost-effective
Can target multiple buyer agents simultaneously
In this example we have market parameters set to maxAssetCount = 5
Put this testsuit below everything in Swan.test.ts
Add minimum price requirement for asset listings or fee floors.
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.