Wrong slashing calculation rewards for operator that did not do his job
The slashing logic in the Holograph operator contract deducts the entire base bond amount from an operator who fails to execute a job, instead of the percentage specified in the documentation. An attacker could exploit this to cause unfair punishment or manipulate rewards, as the full bond is transferred to the next operator rather than a portion.
Submitted by peanuts, also found by ctf_sec, imare, and Jeiwan
Wrong slashing calculation may create unfair punishment for operators that accidentally forgot to execute their job.
Proof of Concept
Docs: If an operator acts maliciously, a percentage of their bonded HLG will get slashed. Misbehavior includes (i) downtime, (ii) double-signing transactions, and (iii) abusing transaction speeds. 50% of the slashed HLG will be rewarded to the next operator to execute the transaction, and the remaining 50% will be burned or returned to the Treasury.
The docs also include a guide for the number of slashes and the percentage of bond slashed. However, in the contract, there is no slashing of percentage fees. Rather, the whole _getBaseBondAmount() fee is slashed from the job.operator instead.
uint256 amount = _getBaseBondAmount(pod);
/**
* @dev select operator that failed to do the job, is slashed the pod base fee
*/
_bondedAmounts[job.operator] -= amount;
/**
* @dev the slashed amount is sent to current operator
*/
_bondedAmounts[msg.sender] += amount;
Documentation states that only a portion should be slashed and the number of slashes should be noted down.
Recommended Mitigation Steps
Implement the correct percentage of slashing and include a mapping to note down the number of slashes that an operator has.
alexanderattar (Holograph) commented:
Valid. The docs are not in sync with the code, but it will be adjusted to handle this correctly.
alexanderattar (Holograph) resolved and commented:
We have changed the slashing logic to use base bonding amount instead of percentage based approach.
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 contract implements slashing by subtracting the full base bond amount rather than a percentage, and does not track the number of slashes as the documentation requires.
Impact
Operators who fail to execute a job lose their entire bond instead of a percentage, and the next operator receives the full amount, which could lead to unfair punishment and reward manipulation.
What the attacker needed
Operator fails to execute a job
The fix
The slashing logic was changed to use the base bonding amount instead of a percentage-based approach.
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, operators put up a deposit (bond) and are supposed to be punished by losing only part of it if they misbehave. The code instead takes the whole deposit and gives it to the next operator, which is harsher than intended and could be abused.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.