# Approval overflow causes DoS in `BalancerRouter`'s `exitPlazaAndBalancer`

BalancerRouter calls safeIncreaseAllowance on BPT whose allowance to the Balancer vault is already uint256.max, overflowing and permanently DoSing exitPlazaAndBalancer withdrawals.

- Payout: Audit contest
- Severity: medium
- Program: Plaza Finance
- Found by: 0xadrii
- Disclosed: 2024-12-16
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2024-12-plaza-finance-judging/issues/835
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-12-plaza-finance%3AM-12
- Tags: area:web3 domain:web3 impact:dos kind:contest platform:sherlock sev:medium tech:evm tech:solidity technique:source-review vuln:dos

**Target:** BalancerRouter.sol _exitBalancerPool / Balancer vault exit
**Root cause:** BalancerPoolToken.allowance returns uint256(-1) when spender is the vault, so SafeERC20.safeIncreaseAllowance computes oldAllowance + value and overflows.
**Steps:**
1. Fork Base mainnet with BPT token 0xC771c1a5905420DAEc317b154EB13e4198BA97D0 and vault 0xBA12222222228d8Ba445958a75a0704d566BF2C8
2. Call `pool.safeIncreaseAllowance(vault, 1e18)`
3. Observe revert with panic 0x11 arithmetic overflow
4. Any call to `exitPlazaAndBalancer` hits the same path in `_exitBalancerPool` and reverts
**How found:** Code-reading of _exitBalancerPool's approval step combined with knowledge that Balancer BPTs override allowance() to return uint256.max for the vault, making the increase overflow.
**Insight:** When integrating with Balancer, remember BPTs grant the vault infinite allowance via an allowance() override; never call increaseAllowance/approve on BPTs for the vault, and check token allowance overrides before adding approval logic.

## Proof of concept (copied exactly from the original report)

**Foundry PoC test triggering approval overflow**

```
contract ContractTest is Test {
    string BASE_RPC_URL = vm.envString("BASE_RPC_URL");

    // -- CREATE CONSTANTS HERE --

    using SafeERC20 for IERC20;

    // -- CREATE STORAGE VARIABLES HERE --

    IERC20 public pool = IERC20(0xC771c1a5905420DAEc317b154EB13e4198BA97D0); // BPT token
    address public vault = 0xBA12222222228d8Ba445958a75a0704d566BF2C8; // Balancer vault

    function setUp() public {
        vm.createSelectFork(BASE_RPC_URL);
    }

    function testBalancer_approvalOverflow() public {
        pool.safeIncreaseAllowance(vault, 1e18); // reverts with arithmetic error
```

