Closed c4-bot-7 closed 8 months ago
Picodes marked the issue as duplicate of #620
Picodes changed the severity to QA (Quality Assurance)
This previously downgraded issue has been upgraded by Picodes
Picodes marked the issue as not a duplicate
Picodes marked the issue as duplicate of #621
Picodes marked the issue as satisfactory
Lines of code
https://github.com/code-423n4/2024-01-salty/blob/main/src/dao/Proposals.sol#L196 https://github.com/code-423n4/2024-01-salty/blob/main/src/dao/Proposals.sol#L240 https://github.com/code-423n4/2024-01-salty/blob/main/src/dao/DAO.sol#L131
Vulnerability details
Impact
A malicious user calling
Proposals::proposeSetContractAddress
with specific names likepriceFeed1
,priceFeed2
,priceFeed3
oraccessManager
, or callingProposals::proposeSendSALT
, can create a Denial of Service (DoS) for these types of proposals, effectively preventing the setting of contracts or sending ofSALT
token.For
proposeSetContractAddress
, this is because the contract set is determined by the specific name of the contract in the ballot, which can be the same as the hash generated. Thus, a malicious user could hijack these names after 45 days of deployment.In the case of
proposeSendSALT
, there's no need to send a specific name, as the function sets the name and only one user can make this proposal at the same time. A user with the minimumrequiredXSalt
balance can make this proposal and deny another proposal afterDAOConfig::ballotMinimumDuration
. They can continually front-run the proposal and send it again if other user try.Proof of Concept
Here, it's evident that the
ballotName
must specifically match for any changes to be made../src/dao/DAO.sol
In the case of proposing to send Salt, the ballotName is set to sendSALT. Due to protocol restrictions, only one proposal with a unique name can be submitted.
./src/dao/Proposals.sol
Tools Used
Manual code review
Recommended Mitigation Steps
Implement a mechanism similar to the protocol used for whitelisting tokens. If a contract needs to be set or SALT sent, the trusted result should be reflected in the election and passed through the proposal process. This approach ensures that anyone with enough tokens to make the proposal can submit a contract_name, and if the correct address wins, it will be sent to the oficial proposal.
Assessed type
DoS