-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Users can skip fee payment to Decent Bridge by bridging directly on DecentEthRouter.sol. #221
Comments
raymondfam marked the issue as sufficient quality report |
raymondfam marked the issue as duplicate of #15 |
alex-ppg marked the issue as not a duplicate |
alex-ppg marked the issue as primary issue |
The Warden has demonstrated how a different function from #590 can also have its fees and signature validation bypassed due to a lack of access control in another function of a different contract. As such, this submission is distinct and a medium-risk grade is appropriate. |
alex-ppg marked the issue as selected for report |
alex-ppg marked the issue as satisfactory |
alex-ppg marked the issue as not selected for report |
alex-ppg marked the issue as duplicate of #647 |
Lines of code
https://github.com/decentxyz/decent-bridge/blob/7f90fd4489551b69c20d11eeecb17a3f564afb18/src/DecentEthRouter.sol#L197-L215
https://github.com/code-423n4/2024-01-decent/blob/07ef78215e3d246d47a410651906287c6acec3ef/src/UTB.sol#L259-L274
Vulnerability details
Impact
Protocol will not get bridge fees.
Proof of Concept
In UTB.sol, the entry point for bridging is through
bridgeAndExecute()
. Users will fill in the BridgeInstructions, FeeStructure and signature as the input parameter. There are three functions called,retrieveAndCollectFees()
,swapAndModifyPostBridge()
,callBridge()
. Note that FeeStructure is a user input.Focusing on callBridge, note that the
bridgeFee
is calculated because callingbridge()
on the BridgeAdapter.This bridge fee is from the user input of
bridgeAndExecute()
, which means the user can set the bridge fee to zero. It wouldn't work on the Stargate bridge because stargate calculates the fees directly in the router -> pool itself.https://optimistic.etherscan.io/address/0xdecc0c09c3b5f6e92ef4184125d5648a66e35298#code
However, when DecentBridgeAdapter.bridge() is called, it will eventually call router.bridgeWithPayload.
The DecentEthRouter.sol does not calculate any fees in the router.
Thus, users can call
bridge()
on DecentEthRouter.sol directly to skip payment of protocol fees and bridge fees since it has public visibility without any modifiers.Tools Used
Manual Review
Recommended Mitigation Steps
Recommend calculating the fees inside the router contract, like how RadiantOFT does it (before the _send() function).
Radiant line 105 (_send() function), line 115-116 (fees).
https://vscode.blockscan.com/arbitrum-one/0x41e018EB5c52d5A400fFb891B8569C8AcFe905f1
So, even if users call the DecantETHRouter directly, they will still have to pay a bridge fee.
Assessed type
Context
The text was updated successfully, but these errors were encountered: