# Malicious caller of processMessage() can pocket the fee while forcing excessivelySafeCall() to fail

Bridge.processMessage pays the caller fee even when the message call fails via EIP-150 63/64 gas griefing, leaving message RETRIABLE while caller pockets reward.

- Payout: Contest reward
- Severity: medium
- Program: Taiko
- Credited: t0x1c
- Disclosed: 2024-04-26
- Write-up quality: 7/10
- Original: https://github.com/code-423n4/2024-03-taiko-findings/issues/97
- Library page: https://bugbountylibrary.com/r/c4%3A2024-03-taiko%3AM-14
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:race-window technique:source-review vuln:business-logic vuln:dos vuln:fee-bypass

**Target:** Bridge.processMessage / excessivelySafeCall external call
**Root cause:** processMessage rewards msg.sender with _message.fee regardless of whether _invokeMessageCall succeeds; the 63/64 EIP-150 rule lets a caller supply just enough gas so the forwarded call OOGs while retaining 1/64 for the refund logic.
**Steps:**
1. Craft a message whose receive() consumes ~10.8M gas with _message.gasLimit = 11_000_000.
2. Call `processMessage{gas: 10_897_060}(message, proof)` as a non-refundTo address.
3. Forwarded gas = 63/64*(10897060-94000) ≈ 10_634_262 < required, so receive() reverts OOG.
4. Remaining 1/64 (~168_797) executes L285-L307: status set RETRIABLE and msg.sender.sendEther(_message.fee) pays caller.
5. Message left RETRIABLE; someone else must later call retryMessage().
**How found:** Noticed fee is paid before/independent of _invokeMessageCall success, then reasoned about EIP-150 63/64 gas forwarding to force the inner call to fail while keeping enough gas for the reward payout; validated with a Foundry test.
**Exploitation:** Attacker monitors pending messages with high gas requirements, calls processMessage with a precisely chosen gas amount so the inner call fails from OOG but the outer refund/reward logic still completes, collecting _message.fee while the message is parked in RETRIABLE.
**Insight:** When a contract pays a caller before or regardless of an external call's success, check whether EIP-150's 63/64 rule lets you starve the inner call of gas while retaining enough for the payout path — measure gas of the post-call logic and set the outer gas accordingly.
