H-1: Cap-funded CCIP routes can redirect second-hop fee refunds and drain hub ETH
Description:
BridgeRouteReceiver allows a first-hop adapter with a nonzero maxHubNativeFeeByAdapter cap to spend hub-held native ETH when params.nextHop.nativeValue exceeds the msg.value delivered with the callback. The receiver only validates the next-hop bridge contract, selector, and amount offset before forwarding nativeValue into the opaque bridge call. It does not decode or overwrite bridge-specific native refund-recipient fields.
This is exploitable for allowlisted second-hop bridge selectors whose calldata includes an explicit native refund recipient, such as send(SendParam,MessagingFee,address) or sendToken(SendParam,MessagingFee,address). An attacker can route through CcipRouteSender into CcipRouteAdapter, set nextHop.nativeValue within the hub cap, and encode the second-hop refund recipient as an attacker-controlled address. _checkHubNativeFeeCap() authorizes the hub contribution, and _callBridgeWithApprovals() treats the route as successful as long as the receiver's balance decreases by the expected native amount. Any unused native fee refunded directly to the attacker bypasses _refundExcessEth(), because that function can only return ETH still held by the receiver.
The reachable source path is CcipRouteSender.bridgeRoute() -> CcipRouteAdapter.ccipReceive() -> BridgeRouteReceiver.executeRoute().
The same adapter-wide sponsorship model also creates the related nested-hub risk described by ZeroCool Fix-review H-01 and Base L-06: if the allowlisted second-hop bridge is another CCIP route sender to another sponsored hub, each hub can apply its own local maxHubNativeFeeByAdapter[CcipRouteAdapter] cap to the same user-originated route. That variant is more topology-dependent, but it reinforces the same missing invariant: hub-native sponsorship is not bound to a specific source lane, route depth, bridge selector, or enforceable refund behavior.
Impact:
High. A public caller can convert hub-funded native fee float into direct refunds to an external address whenever a capped route can invoke a second-hop bridge selector with attacker-controlled native refund fields. The loss is bounded per call by maxHubNativeFeeByAdapter[CcipRouteAdapter] and by the receiver's ETH balance, but the attack is repeatable and can deplete the shared hub-native reserve used by legitimate CCIP route continuations. Severity should scale with the configured cap, available hub ETH float, and whether allowlisted second-hop selectors expose external native refund recipients.
Recommendation:
Only allow hub-funded native routes for bridge selectors whose native refund recipient is fixed to the receiver, or parse and overwrite the refund-recipient field to address(this) before the call. For opaque selectors whose refund behavior cannot be enforced, require the caller to source-fund the full native value and keep the hub cap at zero.
As defense in depth, make hub-native sponsorship provenance-aware and hop-aware. Cap sponsorship by authenticated source lane and sender, or deploy isolated adapters per sponsored lane. For multi-hub CCIP routes, include an authenticated route-depth budget and reject routes that would consume multiple hub subsidies unless the user explicitly funds each hop.
Developer Response:
Fixed in #827 @ 42a08461.
RouteSelectorPolicy.refundPolicy half + corresponding patch step in _validateAndPatchCalldata. When any portion of nextHop.nativeValue comes from hub float, the (bridge, selector) pair must be admin-registered with one of: 0 (reject), HUB_REFUND_IMPLICIT (bridge refunds msg.sender, no patching), or an offset (receiver overwrites that word with address(this) before the call).
- Struct field:
contracts/bridges/BridgeRouteReceiver.sol:127. - Sentinel:
:192. - Admin setter:
:278. - Refund-policy gate + offset patch:
:738onwards.