Anyone can update the address of the Router in the DcntEth contract to any address they would like to set. #721
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
H-01
primary issue
Highest quality submission among a set of duplicates
satisfactory
satisfies C4 submission criteria; eligible for awards
selected for report
This submission will be included/highlighted in the audit report
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
sufficient quality report
This 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() function
has 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() function
can 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() function
or 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
The text was updated successfully, but these errors were encountered: