# DEPOSITOR_ROLE can manipulate b.amount value

Malicious DEPOSITOR_ROLE self-transfers WETH to inflate bribe amount without cost, since WETH skips allowance when src==dst.

- Payout: Audit contest
- Severity: medium
- Program: Redacted Cartel
- Found by: rfa
- Disclosed: 2022-05-11
- Write-up quality: 6/10
- Original: https://code4rena.com/reports/2022-02-redacted-cartel#m-16
- Library page: http://bugbountylibrary.com/r/c4%3A2022-02-redacted-cartel%3AM-16
- Tags: area:web3 domain:web3 impact:integrity kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic

**Target:** BribeVault.sol deposit/safeTransferFrom flow
**Root cause:** BribeVault trusts the briber-supplied amount and calls safeTransferFrom without rejecting briber == address(this); WETH's transferFrom skips allowance deduction when src == dst, so a self-transfer inflates b.amount for free.
**Steps:**
1. Call deposit with token = WETH address and briber = address(this) (the vault itself).
2. Vault executes safeTransferFrom(vault, vault, amount); WETH's transferFrom sees src == dst and skips the allowance branch.
3. balanceOf[src] -= wad then balanceOf[dst] += wad nets to zero, but b.amount is incremented by wad.
4. Repeat to inflate the recorded bribe amount at no cost.
**How found:** Read WETH's transferFrom and noticed the allowance deduction is inside the `src != msg.sender` branch, so a self-transfer bypasses allowance; combined with the vault accepting an arbitrary briber address.
**Exploitation:** A malicious DEPOSITOR_ROLE repeatedly deposits WETH with briber set to the vault address, inflating b.amount without spending tokens, then uses the inflated bribe accounting.
**Insight:** When a contract records an amount from a caller-supplied transfer, check whether the token's transferFrom short-circuits allowance when src == dst (WETH does); reject briber == address(this) and verify balance deltas rather than trusting inputs.

