lack of checks in Factory::setBondPercentDiv allow owner to prevent bonding in Auction::bondForRebalance()
The setBondPercentDiv function lacks checks on the new value, allowing the owner to set it to zero, which causes Auction::bondForRebalance() to revert and prevents bonding.
Originally disclosed on Code4rena
Submitted by Alex the Entreprenerd, also found by goatbug
Impact
setBondPercentDiv has no checks for min and max
Setting bondPercentDiv to 0 will cause Auction::bondForRebalance() to revert
This allows the owner to prevent bonding by setting the bondPercentDiv to 0
Recommended Mitigation Steps
Refactor to
function setBondPercentDiv(uint256 newBondPercentDiv) public override onlyOwner {
require(newBondPercentDiv > AMOUNT);
require(newBondPercentDiv <= AMOUNT_2);
bondPercentDiv = newBondPercentDiv;
}
frank-beard (Kuiper) acknowledged and disagreed with severity:
the owner for this is intended to be a dao that acts in support of the protocol, however this is a good point to the centralization concerns for the protocol, we will most likely manage this by adding a timelock to these function
Alex the Entreprenerd (judge) commented:
Similarly to #119
- Am forfeiting my wins
- Always important to flag up admin privileges so people can use the protocol while being aware of the risks they are undertaking
- Medium severity as depends on a specific config
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 setter function lacks validation to ensure the new value is within a safe range, allowing zero which causes division by zero or similar failure.
Impact
The owner could prevent bonding by setting bondPercentDiv to 0, but this depends on a specific configuration and the owner is intended to be a DAO.
What the attacker needed
Owner privileges
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.
The owner of a smart contract can change a setting that controls how bonds work. If they set it to zero, a key function that relies on it will fail, stopping users from bonding. This is a risk because the owner could intentionally or accidentally break the system.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.