-
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
Deecnt contracts are using same WETH interface across different chains which can disable some critical features #333
Comments
raymondfam marked the issue as sufficient quality report |
raymondfam marked the issue as primary issue |
Function call disruptions due to varied WETH interfaces cross-chain. |
wkantaros marked the issue as disagree with severity |
wkantaros (sponsor) confirmed |
Related to #505, an interesting problem here is that the As-is, I definitely consider it a valid QA issue given that it is a real inconsistency that should be avoided in more explicit ways. |
Submission #429 details the discrepancies between WETH implementations greatly and I thank the Warden for their effort in detailing them. Inspecting #505 will highlight that the WETH asset will not really be transferred in an L2 solution and can be "maliciously" forced to be transferred but would yield no exploitation vector. This and its duplicate submissions differ in that they detail how a transaction may fail by assuming the WETH token is conformant with its Ethereum main-net interface which is incorrect. Inspecting the codebase, we have the following invocations of non-EIP-20 functions that are "safe":
Based on the above, the |
alex-ppg marked the issue as unsatisfactory: |
Lines of code
https://github.com/decentxyz/decent-bridge/blob/7f90fd4489551b69c20d11eeecb17a3f564afb18/src/DecentBridgeExecutor.sol#L60
https://github.com/decentxyz/decent-bridge/blob/7f90fd4489551b69c20d11eeecb17a3f564afb18/src/DecentEthRouter.sol#L178
https://github.com/decentxyz/decent-bridge/blob/7f90fd4489551b69c20d11eeecb17a3f564afb18/src/DecentEthRouter.sol#L275
Vulnerability details
Vulnerability Details
WETH
implementation is different in some chains butDecentEthRouter
andDecentBridgeExecutor
and several other contracts are using same interface for all different chainsProof of Concept
WETH contract is implemented differently in some chains.
polygon mainnet:
https://polygonscan.com/address/0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619#code
deposit
function ofWETH
has 2 parameters:and all calls to this function are restricted to
DEPOSITOR_ROLE
, meaning thatDecentEthRouter
orDecentBridgeExecutor
or other contracts wont be able to call this function.Avalanche C-Chain:
https://avascan.info/blockchain/c/address/0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB/contract
WETH
implementation in Avalanche does not have adeposit
function at all, instead it has amint
functionAll calls to this function are also limited to
bridgeRoles
which means that Decent system contracts wont be able to call this functionIt also does not support a
withdraw
function, instead it has anunwrap
function:Impact
WETH.deposit
orWETH.withdraw
are used in different parts of the codebase, any action that involves making a call toWETH
using an incorrect interface is disabled.Example (not limited to):
https://github.com/decentxyz/decent-bridge/blob/7f90fd4489551b69c20d11eeecb17a3f564afb18/src/DecentBridgeExecutor.sol#L60
https://github.com/decentxyz/decent-bridge/blob/7f90fd4489551b69c20d11eeecb17a3f564afb18/src/DecentEthRouter.sol#L178
https://github.com/decentxyz/decent-bridge/blob/7f90fd4489551b69c20d11eeecb17a3f564afb18/src/DecentEthRouter.sol#L275
Tools Used
Manual review
Recommended Mitigation Steps
use a compatible interface for interacting with
WETH
in different chain.Assessed type
Other
The text was updated successfully, but these errors were encountered: