DecentEthRouter::bridge/bridgeWithPayload
can directly be called, which bypasses UTB main entry point with signature
#66
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-647
satisfactory
satisfies C4 submission criteria; eligible for awards
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/decentxyz/decent-bridge/blob/7f90fd4489551b69c20d11eeecb17a3f564afb18/src/DecentEthRouter.sol#L218-L224
Vulnerability details
Impact
The flow to swapAndBridge/bridgeAndSwap assets is long and starts in UTB contract, where participant provides authenticator signature:
https://github.com/code-423n4/2024-01-decent/blob/07ef78215e3d246d47a410651906287c6acec3ef/src/UTB.sol#L259-L266
The problem is that a malicious actor can directly call
DecentEthRouter::bridge
with unchecked payload data, which means that it can be anything. For example - giving allowance for some ERC20 token from DescentExecutor to the attacker.https://github.com/decentxyz/decent-bridge/blob/7f90fd4489551b69c20d11eeecb17a3f564afb18/src/DecentBridgeExecutor.sol#L61
Another example is provided data, which is not checked by the signer, but reaches the following line and continues down the flow inside
BridgeAdapter::receiveFromBridge
andUTB::receiveFromBridge
Proof of Concept
One example is:
bridgeWithPayload
Tools Used
Manual Review
Recommended Mitigation Steps
Add a modifier on
DecentEthRouter::bridge/bridgeWithPayload
so only BridgeAdapter can access itAssessed type
Access Control
The text was updated successfully, but these errors were encountered: