Front Run of addBlackList() function
A blacklisted address can front-run the transaction that adds it to the blacklist by paying a higher gas fee, allowing it to transfer funds before the blacklist takes effect. This prevents the protocol from later removing those funds via the removeBlackFunds function.
Source: https://github.com/sherlock-audit/2023-02-telcoin-judging/issues/43
Found by
0xAgro, Inspex, J4de, gmx
Summary
Front Run of addBlackList() function
Vulnerability Detail
Front running can be done either by sending a tx with a higher gas price (usually tx are ordered in a block by the gas price / total fee), or by paying an additional fee to the validator if they manage to run their tx without reverting (i.e. by sending additional ETH to block.coinbase, hoping validator will notice it).
Impact
Malicious user could listen the mempool in order to check if he sees a tx of blacklisting for his address , if it happens he could front run this tx by sending a tx with higher gas fee to transfer his funds to prevent them to be removed by removeBlackFunds() function
Code Snippet
Tool used
Manual Review
Recommendation
Use the same mechanism as in StakingModule.sol to prevent user from withdrawing their funds if blacklisted so that front running won't be useful
Discussion
jacksanford1
Admin note: Protocol team confirmed the issue and labeled "Won't Fix."
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
A malicious user could prevent their funds from being removed by the removeBlackFunds function by front-running the blacklist transaction.
What the attacker needed
Attacker is about to be blacklisted; attacker can pay higher gas fee
The fix
The protocol should use the same mechanism as in StakingModule.sol to prevent blacklisted users from withdrawing their funds, making front-running ineffective.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a transaction is sent to a blockchain, it waits in a public pool called the mempool before being added to a block. Anyone can see these pending transactions and pay more to have their own transaction processed first, which is called front-running. Here, a user about to be blacklisted could quickly move their money away before the blacklist stops them.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.