# DualVmToken can be abused to cause RPC-level reverts by revoking native token approval to Kakarot

DualVmToken.approve lacks a spender check, letting an EVM account revoke Kakarot's native-token approval and force RPC-level Cairo reverts on native transfers.

- Payout: Audit contest
- Severity: medium
- Program: Kakarot
- Found by: RadiantLabs
- Disclosed: 2024-12-10
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2024-09-kakarot-findings/issues/48
- Library page: https://bugbountylibrary.com/r/c4%3A2024-09-kakarot%3AM-08
- Tags: area:web3 domain:web3 impact:dos kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:chained technique:source-review vuln:access-control vuln:business-logic vuln:dos

**Target:** DualVmToken EVM precompile contract / Starknet ERC-20 approval
**Root cause:** DualVmToken.approve only validates felt range, not that spender != Kakarot; native transfers assume the account contract holds infinite approval to Kakarot, so revoking it makes settlement delegatecall revert at RPC level.
**Steps:**
1. Deploy contract holding a DualVmToken reference for Kakarot's native ERC-20.
2. In fallback, read `kakarot = DualVmToken.kakarot()` and call `target.approve(kakarot, 0)` to zero the account's approval.
3. Attempt `address(0xdeadbeef).transfer(1 wei)`; native transfer settlement reverts in Cairo, crashing the RPC call regardless of defensive callers like ExcessivelySafeCall.
**How found:** Code review of DualVmToken.approve noticed only a felt-overflow check on spender; cross-referenced account_contract initialize which grants infinite approval to Kakarot, hypothesizing that revoking it breaks native transfer settlement.
**Exploitation:** Any EVM account can self-revoke its infinite native-token approval to Kakarot via DualVmToken.approve(kakarot,0); subsequent native transfers revert at the RPC/Cairo layer, so contracts requiring a call attempt (e.g. sequential bridge message processing) can be permanently blocked, freezing in-flight funds.
**Escalation:** Chained with non-blocking receive patterns (LayerZero _blockingLzReceive) to convert a single account's broken approval into permanent fund lockup in dependent contracts.
**Insight:** In dual-VM designs, check whether user-callable approval functions can target the bridge/system contract itself; system invariants like 'account has infinite approval to router' are attacker-revocable unless explicitly blocked.

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

**DualVmTokenHack contract revoking Kakarot approval**

```
contract DualVmTokenHack {
    DualVmToken target;
    
    constructor(DualVmToken _target) {
        target = _target;
    }

    fallback {
        uint256 kakarot = DualVmToken.kakarot();
        target.approve(kakarot, 0);
        address(0xdeadbeef).transfer(1 wei);
    }
}
```

