Closed c4-bot-2 closed 8 months ago
Picodes marked the issue as primary issue
othernet-global (sponsor) disputed
_userHasActiveProposal is not applicable to the DAO and the behavior is acceptable.
Picodes marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2024-01-salty/blob/main/src/dao/Proposals.sol#L145
Vulnerability details
Proof of Concept
Steps to generate the issue
_possiblyCreateProposal
, daos are allowed to create more than one proposalmarkBallotAsFinalized(ballotId)
whereballotId
is an id of the five created proposals by the dao_userHasActiveProposal[daoAddress]
, return value is false while the dao has another 4 open proposalsThe issue arises because the dao is allowed to create multiple proposals, while a user cannot, in the
markBallotAsFinalized
function implementation, only the case of a user creating only one proposal and deleting it is considered, while the case that the dao might have more than one proposal is not considered. Proposals.sol #145-147In the following discussion with the sponsor, he acknowledged the issue, by confirming that daos are allowed to create more than one proposal, and from the code, we can see clearly that the case is not handled
chat
Tools Used
Manual Review, vs code
Recommended Mitigation Steps
Have separate logic proposal deletion in case of a dao is the one created the proposal, check if the dao has more proposal and if none then remove.
Assessed type
Governance