-
Notifications
You must be signed in to change notification settings - Fork 3
Anyone can update the address of the Router in the DcntEth contract to any address they would like to set. #721
Copy link
Copy link
Open
Labels
3 (High Risk)Assets can be stolen/lost/compromised directlyAssets can be stolen/lost/compromised directlyH-01bugSomething isn't workingSomething isn't workingprimary issueHighest quality submission among a set of duplicatesHighest quality submission among a set of duplicatessatisfactorysatisfies C4 submission criteria; eligible for awardssatisfies C4 submission criteria; eligible for awardsselected for reportThis submission will be included/highlighted in the audit reportThis submission will be included/highlighted in the audit reportsponsor confirmedSponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")sufficient quality reportThis report is of sufficient qualityThis report is of sufficient quality
Metadata
Metadata
Assignees
Labels
3 (High Risk)Assets can be stolen/lost/compromised directlyAssets can be stolen/lost/compromised directlyH-01bugSomething isn't workingSomething isn't workingprimary issueHighest quality submission among a set of duplicatesHighest quality submission among a set of duplicatessatisfactorysatisfies C4 submission criteria; eligible for awardssatisfies C4 submission criteria; eligible for awardsselected for reportThis submission will be included/highlighted in the audit reportThis submission will be included/highlighted in the audit reportsponsor confirmedSponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")sufficient quality reportThis report is of sufficient qualityThis report is of sufficient quality
Lines of code
https://github.com/decentxyz/decent-bridge/blob/7f90fd4489551b69c20d11eeecb17a3f564afb18/src/DcntEth.sol#L20-L22
Vulnerability details
Impact
By allowing anybody to set the address of the Router contract to any address they want to set it allows malicious users to get access to the mint and burn functions of the DcntEth contract.
Proof of Concept
The
DcntEth::setRouter() functionhas not an access control to restrict who can call this function. This allows anybody to set the address of the router contract to any address they'd like to set it.The functions
DcntEth::mint() function&DcntEth::burn() functioncan be called only by the router contract.A malicious user can set the address of the router contract to an account of their own and:
DcntEth::mint() functionor theDcntEth::burn() function, if the router address is set to be different than the address of the DecentEthRouter, all the calls made from the DecentEthRouter to the DcnEth contract will revert.Tools Used
Manual Audit
Recommended Mitigation Steps
Make sure to add an Acess Control mechanism to limit who can set the address of the Router in the DcnEth contract.
Assessed type
Access Control