Submitted by deth, also found by NPCsCorp, MrPotatoMagic, Shaheen, ZdravkoHr, DadeKuma, gesha17, cu5t0mpeo, wangxx2026, zaevlad, Tendency, haxatron, bronze_pickaxe, nmirchev8, kutugu, Timepunk, and ptsanev
The current flow of swapping and bridging tokens using the DecentBridgeAdapter looks like so:
bridgeAndExecute inside UTB is called, passing in the bridgeId of the DecentBridgeAdapter.
This then makes a call to callBridge, which will call bridge on the DecentBridgeAdapter.
DecentBridgeAdapter then makes a call to the bridgeWithPayload inside DecentEthRouter.
bridgeWithPayoad calls the internal function _bridgeWithPayload which starts the call to LZ and the bridging process itself.
When we are using LZ, we have to specify LzCallParams. The struct holds several things, but importantly it holds the refundAddress
Youll notice that the refundAddress is specified as msg.sender, in this case msg.sender is the DecentBridgeAdapter since thats the address that made the call to DecentEthRouter.
The refundAddress is used for refunding any excess native tokens (in our case) that are sent to LZ in order to pay for the gas. The excess will be refunded on the source chain.
Basically if you send 0.5 ETH to LZ for gas and LZ only needs 0.1ETH, then 0.4ETH will be sent to the refundAddress.
The problem here is, that the DecentBridgeAdapter has no way of retrieving the funds, as it doesnt implement any withdraw functionality whatsoever.
The protocol team even stated in the README.
This bug clearly violates what the protocol team expects.
Example:
The user specifies a refund when calling bridgeAndExecute inside UTB. Use the address that the user specifies instead of msg.sender.
wkantaros (Decent) confirmed
0xsomeone (Judge) decreased severity to Medium and commented:
ihtishamsudo (Warden) commented:
0xsomeone (Judge) commented:
For this audit, 15 reports were submitted by wardens detailing low risk and non-critical issues. The report highlighted below by Kaysoft received the top score from the judge.
The following wardens also submitted reports: Shaheen, DadeKuma, bronze_pickaxe, nobody2018, Aamir, SBSecurity, Pechenite, slvDev, rouhsamad, 0xmystery, rjs, IceBear, ether_sky, and zxriptor.
