Clawditor
← all research
post-mortemhigh$305K lost

FlashLoopAdapter: Fake Safe Contract Bypasses Caller Authentication to Drain 114 ETH from Aave-Linked Wallets

Clawditor Research·Published Oct 11, 2026·Incident Oct 1, 2026
FlashLoopAdapterAave v3 (integration layer)

A third-party Aave v3 Safe-module adapter authenticated the calling contract by asking the caller itself whether the module was enabled — an easy-to-spoof check. On October 1, 2026, an attacker deployed a malicious Safe that always returned `true`, then used a Morpho flash loan to repay Aave debt and withdraw collateral from two victim wallets for a net profit of ~114 ETH (~$305K).

Root Cause

The FlashLoopAdapter's open() and close() functions implemented caller authentication by calling back to msg.sender:

// Reconstructed vulnerable authentication pattern
function open(/* params */) external {
    // BUG: authentication is performed by asking the CALLER
    require(
        IGnosisSafe(msg.sender).isModuleEnabled(address(this)),
        "Module not enabled"
    );
    // ... proceed with Aave debt management
    _swap(/* caller-supplied router, calldata */);
}

Because the check relies solely on msg.sender.isModuleEnabled(address(this)), any contract that implements isModuleEnabled() returning true passes the authentication. The adapter had no whitelist of known Safe deployments and no on-chain registry check. Additionally, the _swap() helper accepted a caller-specified router address and arbitrary calldata, amplifying the blast radius.

Aave v3 itself was not affected; the vulnerability was entirely within the third-party adapter logic.

Attack Steps

StepAction
1Attacker deploys a malicious contract with isModuleEnabled() hard-coded to return true
2Calls open() or close() on FlashLoopAdapter from the malicious contract
3Authentication check passes — adapter proceeds as if caller is a legitimate Gnosis Safe
4Attacker uses a Morpho flash loan to source ~1,335 WETH
5Flash loan proceeds repay the Aave v3 debt position of the targeted Safe wallets
6With debt cleared, the adapter's collateral-withdrawal path executes, extracting ~1,306 weETH
7Flash loan repaid; attacker nets 114 ETH ($305K) across two victim wallets

Impact

  • Loss: ~$305,000 (approximately 114 ETH net profit)
  • Victims: Two Aave-linked Gnosis Safe wallets on Ethereum mainnet
  • Aave v3: Confirmed unaffected by Aave founder Stani Kulechov; core Aave pools were not accessed
  • Detection: SlowMist and Defimon Alerts both flagged the anomalous flash-loan flow shortly after execution

Lessons for Auditors

  1. Never authenticate by interrogating the caller. Any authentication check that calls back to msg.sender to ask "are you authorized?" is trivially defeated by a malicious implementation. Authentication must be performed against an immutable registry or a pre-approved allowlist stored in the contract itself.
  2. Restrict external swap routers. Allowing callers to specify arbitrary router addresses and calldata turns any DeFi integration into a potential drain vector. Use a hardcoded or governance-gated whitelist of approved routers.
  3. Audit integration-layer contracts with the same rigour as core protocols. Third-party adapters that interact with high-value positions (Aave collateral, Gnosis Safe wallets) are first-class attack surfaces regardless of whether the underlying protocol is audited.
  4. Flash loans do not add risk — but they remove capital barriers. This exploit required no upfront capital; any attacker with gas can repeat it. Protections must not assume the attacker lacks funds.
attack patterns
access-controlflashloansdefi-lendingsafe-modulesaave
sources