Adversary can prevent updating price feed addresses by creating poisonous proposals ending in _confirm
A check meant to prevent duplicate confirmation proposals can be abused by creating a proposal whose ballot name ends in '_confirm', which then blocks legitimate proposals for the same change. An attacker can repeatedly prevent updates to price feed contracts and website URLs, disrupting DAO operations.
juancito Follow with falconhoof, gkrastenov and 19 others
Originally disclosed on Code4rena
Submitted by juancito, also found by falconhoof, gkrastenov, memforvik, 0xAsen, jasonxiale, 0x3b, 0xpiken, Ward, Limbooo, israeladelaja, 0xPluto, t0x1c, a3yip6, PENGUN, haxatron, miaowu, Myrault, b0g0, linmiaomiao, nonseodion, 0xAlix2 (1, 2), and y4y
An adversary can prevent the creation of setContract and websiteUpdate proposals by creating a poisonous proposal with the same ballot name + _confirm. This attack can be performed repeatedly every few days (when the voting period ends).
Affected proposals:
setContract:priceFeed1->setContract:priceFeed1_confirmsetContract:priceFeed2->setContract:priceFeed2_confirmsetContract:priceFeed3->setContract:priceFeed3_confirmsetContract:accessManager->setContract:accessManager_confirmsetURL:{{newWebsiteURL}}->setURL:{{newWebsiteURL}}_confirm
This is especially worrisome for the setContract proposals, as it prevents changing the price feed contracts, which are used for USDS borrowing and liquidations.
Note: This Impact fits into the Attack Ideas: “Any issue that would prevent the DAO from functioning correctly.”
Vulnerability Details
setContract and websiteUpdate proposals are executed in multiple steps.
Here’s the process for changing the Price Feed 1, as an example:
- A new proposal is created with a ballot name
setContract:priceFeed1 - The proposal is voted, and when it wins, a confirmation proposal is created, appending
_confirmto the ballot name, resulting insetContract:priceFeed1_confirm. - When the confirmation proposal wins, it checks its ballot name and then it sets the new price feed.
The problem is that there is a check in _possiblyCreateProposal() that can be exploited:
require( openBallotsByName[ string.concat(ballotName, "_confirm")] == 0, "Cannot create a proposal for a ballot with a secondary confirmation" );
This check is intended to prevent creating new proposals if there is a pending confirmation proposal being voted for the same change, but an adversary can use it to create a proposal with a ballot name setContract:priceFeed1_confirm, by setting priceFeed1_confirm as the contract name.
If someone tries to create a legit priceFeed1 proposal later, it will revert, leading to a DOS.
This holds for all proposals mentioned in the Impact section.
Proof of Concept
- Add the test to
src/dao/tests/Proposals.t.sol - Run
COVERAGE="no" NETWORK="sep" forge test -vv --rpc-url https://1rpc.io/sepolia --mt "testProposeSetContractAddress_confirm"
function testProposeSetContractAddress_confirm() public {
uint256 initialNextBallotId = proposals.nextBallotID();
// Alice is the adversary
vm.startPrank(alice);
staking.stakeSALT(1000 ether);
// Create a poisonous proposal with a ballot name ending in `_confirm`
address newAddress = address(0x1111111111111111111111111111111111111112);
proposals.proposeSetContractAddress("priceFeed1_confirm", newAddress, "description");
assertEq(proposals.nextBallotID(), initialNextBallotId + 1); // proposal was created successfully
vm.stopPrank();
// Transfer some tokens to Bob who wants to create a legit proposal
vm.startPrank(DEPLOYER);
salt.transfer(bob, 1000 ether);
vm.stopPrank();
// Bob can't create a legit proposal to change the contract address of `priceFeed1`
vm.startPrank(bob);
staking.stakeSALT(1000 ether);
vm.expectRevert("Cannot create a proposal for a ballot with a secondary confirmation");
proposals.proposeSetContractAddress("priceFeed1", newAddress, "description");
}
Recommended Mitigation Steps
Given the current implementation, the most straightforward fix would be to prevent the creation of proposals with ballot names ending in _confirm for proposals that need a confirmation.
This would mean checking the contractName in proposeSetContractAddress(), and the newWebsiteURL in proposeWebsiteUpdate().
But, as a recommendation, I would suggest refactoring createConfirmationProposal() to pass a “confirmation” parameter to _possiblyCreateProposal(), so that confirmation proposals don’t rely on the ballot name.
othernet-global (Salty.IO) confirmed and commented:
confirm_ is now prepended to automatic confirmation ballots form setWebsiteURL and setContract proposals.
https://github.com/othernet-global/salty-io/commit/5aa1bc1ddadd67cd875de932633948af25ff8957
The stablecoin framework: /stablecoin, /price_feed, WBTC/WETH collateral, PriceAggregator, price feeds and USDS have been removed: https://github.com/othernet-global/salty-io/commit/88b7fd1f3f5e037a155424a85275efd79f3e9bf9
Here assets are not at direct risk but a “function of the protocol or its availability could be impacted”
Note: For full discussion, see here.
Status: Mitigation confirmed. Full details in reports from 0xpiken, zzebra83, and t0x1c.
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
The system relies on ballot names ending in '_confirm' to identify confirmation proposals, but does not prevent users from creating proposals with such names directly.
Impact
An attacker can repeatedly prevent the DAO from updating price feed contracts and website URLs, which could disrupt USDS borrowing and liquidations.
What the attacker needed
Attacker holds enough SALT to propose; attacker can create proposals
The fix
The fix was to prepend 'confirm_' to automatic confirmation ballots for setWebsiteURL and setContract proposals, and the stablecoin framework was later removed.
How it was found
- Attacker stakes SALT tokens to gain proposal rights.
- Attacker creates a proposal with a contract name ending in '_confirm' (e.g., 'priceFeed1_confirm').
- The proposal is created successfully and occupies the ballot name.
- A legitimate user tries to create a proposal for the same contract (e.g., 'priceFeed1').
- The legitimate proposal reverts due to the existing '_confirm' ballot.
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.
A DAO is a group that votes on changes. Some changes need two votes: a first proposal and a confirmation. The code checks if a confirmation already exists by looking at the proposal's name. An attacker can create a fake proposal with a name that looks like a confirmation, so the real first proposal is blocked. This can be repeated to stop important updates.
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.