Decent - Inference's results

Decent enables one-click transactions using any token across chains.

General Information

Platform: Code4rena

Start Date: 19/01/2024

Pot Size: $36,500 USDC

Total HM: 9

Participants: 113

Period: 3 days

Judge: 0xsomeone

Id: 322

League: ETH

Decent

Findings Distribution

Researcher Performance

Rank: 45/113

Findings: 2

Award: $52.58

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/decentxyz/decent-bridge/blob/7f90fd4489551b69c20d11eeecb17a3f564afb18/src/DcntEth.sol#L20

Vulnerability details

Impact

  • Unlimited minting or burning of tokens in DcntEth ERC20 token contract
  • Stealing all WETH available in DecentEthRouter contract

Proof of Concept

A possible attack scenario to steal all WETH available in DecentEthRouter contract could look like:

  1. Adversary sets the router address to his own EOA.
  2. Adversary mints token to his own EOA using the mint function
  3. Adversary redeems ETH or WETH by using the function redeemETH or redeemWeth.

Tools Used

Manual review.

Ensure that the function setRouter can only be called by authorized roles, e.g. by adding the onlyOwner modifier.

Assessed type

Access Control

#0 - c4-pre-sort

2024-01-24T06:20:20Z

raymondfam marked the issue as sufficient quality report

#1 - c4-pre-sort

2024-01-24T06:20:26Z

raymondfam marked the issue as duplicate of #14

#2 - c4-judge

2024-02-03T13:24:08Z

alex-ppg marked the issue as satisfactory

Findings Information

Awards

52.4591 USDC - $52.46

Labels

bug
3 (High Risk)
insufficient quality report
partial-50
upgraded by judge
duplicate-436

External Links

Lines of code

https://github.com/decentxyz/decent-bridge/blob/7f90fd4489551b69c20d11eeecb17a3f564afb18/src/DecentBridgeExecutor.sol#L36 https://github.com/decentxyz/decent-bridge/blob/7f90fd4489551b69c20d11eeecb17a3f564afb18/src/DecentBridgeExecutor.sol#L44 https://github.com/decentxyz/decent-bridge/blob/7f90fd4489551b69c20d11eeecb17a3f564afb18/src/DecentBridgeExecutor.sol#L63

Vulnerability details

Impact

Locked ETH/WETH

Proof of Concept

The LayerZero solution enables trustless inter-chain transactions with the objective of connecting various blockchain networks. Its aim extends beyond supporting only EVM-compatible chains, allowing the sender of a transaction to be any chain supported by LayerZero.

In the fallback scenarios (#1, #2, and #3), the DecentBridgeExecutor contract sends WETH or ETH to the 'from' address, representing the sender's address on the chain where the transaction originated.

The 'from' address receiving ETH/WETH may not be under the control of the sender, for example in cases where non-EVM chains are the source of the transaction or smart contract not existing in the destination's chain.

The executor contract is invoked by the DecentEthRouter when an onOFTReceived is triggered, typically upon receiving a dcntEth OFTv2.

Tools Used

Manual review.

Consider not sending WETH/ETH to the from address in a fallback scenario.

Assessed type

Other

#0 - c4-pre-sort

2024-01-24T08:09:21Z

raymondfam marked the issue as insufficient quality report

#1 - c4-pre-sort

2024-01-24T08:09:31Z

raymondfam marked the issue as duplicate of #27

#2 - alex-ppg

2024-02-02T17:25:41Z

The submission does not detail the vulnerability in length and additionally misses the fact that the address will be incorrect in all normal usage operations as the primary submission details.

#3 - c4-judge

2024-02-02T17:25:45Z

alex-ppg marked the issue as partial-50

#4 - c4-judge

2024-02-04T23:04:02Z

alex-ppg changed the severity to 3 (High Risk)

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter