Open hats-bug-reporter[bot] opened 1 month ago
Those interactions do not increase the cost, other than raising gas costs for everyone in the chosen network. If there's a way those dust attacks can increase the gas cost of legitimate users (without involving DoSing the entire blockchain), it's on you to prove how exactly it raises gas costs. Because actually I think that if you dust someone they'll even be able to do those transactions CHEAPER, not more expensive, thanks to non-zero -> non-zero SSTOREs.
Yeah, gas usage is at platform level and it's well known you can spam TX to increase gas cost (for everyone, but by spending a crazy amount of money yourself).
Per contest rules, are excluded:
Github username: -- Twitter username: -- Submission hash (on-chain): 0xc454e59a3a6bcded06ae61257c38a5cf98255737ede752b8a7c454efb38dab97 Severity: medium
Description: Description
The Router, MainnetRouter, and GnosisRouter contracts contain functions for managing positions (splitting, merging, and redeeming) that do not implement minimum amount checks or other safeguards against small transactions. This allows users to perform transactions with arbitrarily small amounts, including dust amounts.
A malicious actor could exploit this vulnerability by repeatedly calling these functions with minimal amounts:
In Router.sol, an attacker could repeatedly call
splitPosition()
ormergePositions()
with very smallamount
values. For example:In MainnetRouter.sol, an attacker could flood the network with tiny DAI transactions:
In GnosisRouter.sol, an attacker could send numerous transactions with minimal xDAI:
By executing these functions repeatedly with minimal amounts, an attacker could potentially congest the network, causing increased gas costs, transaction delays, and possibly preventing legitimate users from interacting with the protocol.
Proof of Concept (PoC) File
All showcased logic below lacks a minimum amount check, allowing dust transactions. As stated above an attacker could call this functions repeatedly with dust amounts to congest the network.
Router.sol:
MainnetRouter.sol:
GnosisRouter.sol:
Recommended Mitigations
To protect against potential DoS attacks through dust transactions, the protocol can implement some of the following measures:
Introduce a minimum transaction amount:
Make the minimum amount configurable:
Use a gas price floor:
By implementing one or more of these measures, the protocol can significantly reduce its vulnerability to dust transaction-based DoS attacks while maintaining functionality for legitimate users.