Skip to content
DoS Audit finding Intermediate

DOS of proposals by abusing ballot names without important parameters

Ballot names did not include all proposal parameters, so an attacker could create a proposal with the same name as a legitimate one and block it from being created. This could repeatedly deny the DAO's ability to create certain proposals, such as sending SALT or updating contract addresses.

juancito Follow with 0xRobocop, pina and 11 others

Originally disclosed on Code4rena

Submitted by juancito, also found by 0xRobocop, pina, DanielArmstrong, zhaojie, 0xCiphky, erosjohn, PENGUN, twcctop, haxatron, J4X, klau5, 0xWaitress, and lanrebayode77

https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/dao/Proposals.sol#L101-L102

https://github.com/code-423n4/2024-01-salty/blob/53516c2cdfdfacb662cdea6417c52f23c94d5b5b/src/dao/Proposals.sol#L196

An adversary can prevent legit proposals from being created by using the same ballot name.

Proposals with the same name can’t be created, leading to a DOS for some days until the voting phase ends. This can be done repeatedly, after finalizing the previous malicious proposal and creating a new one.

Impacts for each proposal function:

  • proposeSendSALT(): DOS of all proposals
  • proposeSetContractAddress(): DOS of specific contract setting by proposing a malicious address
  • proposeCallContract(): DOS of specific contract call by providing a wrong number
  • proposeTokenWhitelisting(): DOS of token whitelisting by providing a fake tokenIconURL
  • All: Prevent the creation of any legit proposal, by providing a fake/malicious description to discourage positive voting

Note: This Impact fits into the Attack Ideas: “Any issue that would prevent the DAO from functioning correctly.”

Vulnerability Details

The main issue is that ballots with the same name revert, and the name doesn’t contain all the important parameters to create the proposal:

// Make sure that a proposal of the same name is not already open for the ballot
require( openBallotsByName[ballotName] == 0, "Cannot create a proposal similar to a ballot that is still open" );

Proposals.sol#L101-L102

proposeSendSALT() Vulnerability Details

Let’s see for example the “Send SALT” proposal. It always has the same name sendSALT. Despite this appears to be an expected behaviour, it can be exploited by an adversary.

The minimum ballot duration is 3 days, with a default value of 10 days. Given that ballots can’t be finalized before that, an adversary can consistently create malicious proposals to send themselves the SALT token. The proposal will enter the voting period for some days, and when the phase ends, the adversary can finalize it, and immediately create the same proposal.

This will prevent any other legit “Send SALT” proposal from being created.

There are no mechanisms to remove these malicious proposals, or to prevent malicious actors from creating them, nor removing their stake. The cost for the adversary is meaningless, as it requires to execute a tx every few days, and they can still claim rewards from the staked assets needed for the proposals.

proposeSetContractAddress() Vulnerability Details

Only the contractName is considered for the ballot name, but not the newAddress.

This means that an attack can be performed to consistently create proposals for a specific contract with a malicious address. This prevents updating the price feeds and the access manager.

proposeCallContract() Vulnerability Details

Only the contractName is considered for the ballot name, but not the number with which it will be called.

Same as with the previous attack, an adversary can target a specific contract, and consistently create proposals with a wrong calling number.

proposeTokenWhitelisting() Vulnerability Details

The tokenIconURL is missing in the ballot name, so whitelisting proposals can be maliciously created for a specific token with a wrong token icon.

description() Vulnerability Details

No proposal includes the description (or its hash) in its ballot name. So an adversary can prevent the creation of the legit proposal, by frontrunning it for example, and change the description to something that users would not vote for.

Proof of Concept

This test for proposeSendSALT() already shows how a new proposal can’t be created when there is an existing one. An adversary can exploit that as explained on the Vulnerability Details section. That test could be extended to all the other mentioned functions with their corresponding impacts.

Recommended Mitigation Steps

In order to prevent the DOS, ballot names (or some new id variable) should include ALL the attributes of the proposal: ballotType, address1, number1, string1, and string2. Strings could be hashed, and the whole pack could be hashed as well.

So, if an adversary creates the proposal, it would look exactly the same as the legit one.

In the particular case of proposeSendSALT(), strictly preventing simultaneous proposals as they are right now will lead to the explained DOS. Some other mechanism should be implemented to mitigate risks. One way could be to set a long enough cooldown for each user, so that they can’t repeatedly send these type of proposals (take into account unstake time).

othernet-global (Salty.IO) confirmed and commented:

ballotNames now include all provided proposal arguments.

https://github.com/othernet-global/salty-io/commit/39921b4a25041c7ac4e9b5279e12bb2ec518140b

Picodes (Judge) commented:

Flagging as duplicate of #621 all issues about the fact that identifying proposals by names that are not sender-specific and do not include all arguments opens the door to being front-run and could lead to a DoS. Not all reports found all the different cases where this could happen but I gave full credit to the one where the impact was Medium.

Status: Mitigated with an Error. Full details in report from t0x1c, and also included in the Mitigation Review section below.


The original report as published on Code4rena, by juancito. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the ballot name used to enforce uniqueness did not include all proposal parameters, allowing collisions with legitimate proposals.

Impact

Legitimate proposals of certain types could be blocked for days at a time, and this could be repeated, preventing the DAO from functioning correctly.

What the attacker needed

Ability to submit proposals; staked assets for proposals

The fix

Ballot names were changed to include all proposal arguments, and a cooldown for send SALT proposals was suggested.

How it was found

  1. Create a proposal with the same ballot name as a legitimate proposal, using malicious or incorrect parameters.
  2. The legitimate proposal cannot be created because a proposal with that name is already open.
  3. Wait for the voting period to end, finalize the malicious proposal, and immediately create another one with the same name to keep blocking.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

In this system, each proposal must have a unique name while it is open. The name was built from only some of the proposal's details, so an attacker could submit a proposal with the same name as a real one and stop the real one from being created. This is like reserving a username so nobody else can use it.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by juancito

View all

14 more disclosed reports, best first.

More from Salty.IO

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.