Vulnerability in Swan.sol where role separation between operators and owners can be bypassed through delegation, allowing privilege escalation.
we can see the operator assignments in initialize()
: https://github.com/Cyfrin/2024-10-swan-dria/blob/c3f6f027ed51dd31f60b224506de2bc847243eb7/contracts/swan/Swan.sol#L141-L144
This is a bug because:
The contract allows the owner to also be an operator
The delegated access system doesn't prevent an operator from being delegated access by a user who is also the owner
This creates a path where role separation can be violated by having the owner's privileges leak through operator delegation
In Swan.sol#list
: https://github.com/Cyfrin/2024-10-swan-dria/blob/c3f6f027ed51dd31f60b224506de2bc847243eb7/contracts/swan/Swan.sol#L157-L182
For Swan.sol's initialization and access control logic: https://github.com/Cyfrin/2024-10-swan-dria/blob/c3f6f027ed51dd31f60b224506de2bc847243eb7/contracts/swan/Swan.sol#L118-L145
Impact:
The function accepts any address as _buyer
without verifying it was created through the official BuyerAgentFactory
. This allows malicious actors to create fake buyer contracts that could manipulate the market.
Without price bounds validation, attackers could:
List assets at extreme prices affecting market statistics
Create overflow conditions in fee calculations
Potentially block legitimate transactions through gas manipulation
These vulnerabilities directly affect the core listing functionality of Swan protocol and could disrupt the marketplace operations.
Breaking the trust model of verified buyer agents
Allowing market manipulation through fake listings
Potentially trapping seller assets with malicious buyers
Manual Review
Alternative approach:
Implement role hierarchy system
Add buyer registry validation
Enforce strict separation between owner and operator roles
Add price bounds and validation checks
Implement buyer contract verification system
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.