Open c4-bot-8 opened 10 months ago
raymondfam marked the issue as sufficient quality report
raymondfam marked the issue as duplicate of #14
alex-ppg marked the issue as satisfactory
This and all relevant submissions correctly specify that the lack of access control in the DcntEth::setRouter
function can be exploited maliciously and effectively compromise the entire TVL of the Decent ETH token.
A high-risk severity is appropriate, and this submission was selected as the best due to detailing all possible impacts:
UTB
alex-ppg marked the issue as selected for report
wkantaros (sponsor) confirmed
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.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