DEPOSITOR_ROLE can manipulate b.amount value
A privileged depositor role could perform a self-transfer of WETH to artificially increase the recorded bribe amount without actually transferring any new tokens. This could allow the attacker to inflate bribe amounts at no cost.
Submitted by rfa, also found by Omik
Malicious DEPOSITOR_ROLE can doing self transfer and manipulate b.amount
Proof of Concept
In case malicious DEPOSITOR_ROLE inputing WETH address and putting briber == address(this) in safeTransferFrom argument (which is self transfering). Therefore, it is posible to increase b.amount without any cost.
WETH token contract:
//Line 62 WETH contract
function transferFrom(address src, address dst, uint wad)
public
returns (bool)
{
require(balanceOf[src] >= wad);
if (src != msg.sender && allowance[src][msg.sender] != uint(-1)) {
require(allowance[src][msg.sender] >= wad);
allowance[src][msg.sender] -= wad; // <----------- this line won't executed
}
balanceOf[src] -= wad;
balanceOf[dst] += wad;
Transfer(src, dst, wad);
return true;
}
If the condition didn’t pass (in this case msg.sender != src ), the transaction will treated like a transfer (doesn’t need an allowance), Therefore its possible to do self transfer
Recommended Mitigation Steps
I recommend to validate that bribe != Address(this)
Alex the Entreprenerd (judge) commented:
I’m marking the finding as unique because of the interesting mechanic. Some ERC20 will revert on trying to transfer to yourself, however the warden showed a specific exploit, using WETH, that could be used against the vault.
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
Root cause
Likely the contract fails to check that the bribe recipient is not the contract itself, allowing a self-transfer to be counted as a new deposit.
Impact
A malicious depositor could inflate bribe amounts without spending tokens, potentially disrupting the bribe system; the judge noted that some ERC20 tokens would revert on self-transfer, but WETH allowed the exploit.
What the attacker needed
DEPOSITOR_ROLE privileges; WETH token used
How it was found
- As a malicious DEPOSITOR_ROLE, call the deposit function with the WETH token address.
- Set the briber argument to the vault's own address (address(this)).
- The WETH transferFrom executes as a self-transfer, increasing the recorded bribe amount without cost.
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.
A smart contract lets a special user (the depositor) record bribes. The contract trusts that when the depositor says tokens were transferred, they really were. But by sending tokens to itself, the depositor can make the contract think a new bribe was added when nothing new was paid.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.