The abortAskOffer() function in the PreMarkets.sol contract fails to transfer the tax income from the offer maker to the taker. This omission allows attackers to repeatedly create and abort offers, potentially stealing funds through the accumulation of untransferred tax income.
The abortAskOffer() function allows the offer maker to abort an Ask offer without transferring the accumulated tax income to the taker. This omission enables the offer maker to retain the tax income that should have been distributed to the taker, creating an opportunity for abuse.
An attacker can repeatedly create offers, collect the tax income, and then abort the offers without transferring the income to the taker. Over time, this can result in significant financial losses for takers, while the attacker benefits from the accumulated funds.
The ability to repeatedly create and abort offers to steal funds incentivizes malicious actors to exploit this flaw, leading to potential market manipulation and loss of trust in the platform.
This is the test code of the vulnerability.
The result is like this.
As you can see, the offer maker (user) stole funds from the offer taker (user2) using tax income.
Manual code review
This vulnerability can be addressed by adding logic to calculate and transfer the tax income as part of the offer abortion process.
Valid high severity, given orginal offer makers are not a trusted entity to enforce a settlement. The trade tax set by the maker should be returned back to the takers to avoid abuse of abortion of ask offers to steal trade tax from takers. Note for appeals period: See issue #528 for additional details
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.