Validator status function emit misleading event
The setValidatorStatus function emits the ValidatorStatusUpdated event even when the new status equals the current status, so no actual change occurs. Off-chain consumers could be misled into thinking a validator's status changed when it did not.
Originally disclosed on Immunefi
- Disclosed after under an hour
49668 sc insight validator status function emit misleading event
Submitted on Jul 18th 2025 at 03:39:23 UTC by @holydevoti0n for Attackathon | Plume Network
- Report ID: #49668
- Report Type: Smart Contract
- Report severity: Insight
- Target: https://github.com/immunefi-team/attackathon-plume-network/blob/main/plume/src/facets/ValidatorFacet.sol
Summary
The function ValidatorFacet::setValidatorStatus emits the ValidatorStatusUpdated event unconditionally, including when the supplied status matches the validator's current status. Off-chain consumers can be misled into believing a status change occurred when it did not.
Vulnerability Details
In ValidatorFacet.sol the function emits the ValidatorStatusUpdated event outside the conditional that checks whether the status actually changes. When an admin calls setValidatorStatus with the same status already stored for the validator, no state change occurs, but the event is still emitted.
Example excerpt:
function setValidatorStatus(
uint16 validatorId,
bool newActiveStatus
) external onlyRole(PlumeRoles.ADMIN_ROLE) _validateValidatorExists(validatorId) {
// ...
bool currentStatus = validator.active;
// @audit If status is actually changing
if (currentStatus != newActiveStatus) {
...
}
// @audit-issue Event is emitted unconditionally, even when no change occurs
emit ValidatorStatusUpdated(validatorId, newActiveStatus, validator.slashed);
}
Impact
Off-chain systems that rely on events to track validator status transitions will receive misleading notifications indicating a status change when none happened. This may lead to incorrect UI/state, automation triggers, or alerting based on presumed changes.
Recommendation
Emit the event only when the status actually changes. Additionally, consider reverting or returning an error when an admin attempts to set the status to the same value (to avoid confusing off-chain logic). Example modification:
function setValidatorStatus(
uint16 validatorId,
bool newActiveStatus
) external onlyRole(PlumeRoles.ADMIN_ROLE) _validateValidatorExists(validatorId) {
// ... other code ...
bool currentStatus = validator.active;
// If status is actually changing
if (currentStatus != newActiveStatus) {
// ... logic to handle state changes ...
+ emit ValidatorStatusUpdated(validatorId, newActiveStatus, validator.slashed);
}
+ else {
+ revert IncorrectStatusSet(newActiveStatus);
}
- emit ValidatorStatusUpdated(validatorId, newActiveStatus, validator.slashed);
}
(Keep error type/naming consistent with the project's patterns if adopting a revert.)
Proof of Concept
{% stepper %}
{% step %}
Assume validator ID 1 exists with active = true.
{% endstep %}
{% step %}
An admin calls ValidatorFacet::setValidatorStatus(1, true) (setting to the same status).
{% endstep %}
{% step %}
The code checks if (currentStatus != newActiveStatus), which evaluates to false, so no state changes occur.
{% endstep %}
{% step %}
Despite no change, the function still emits: ValidatorStatusUpdated(1, true, slashed).
{% endstep %}
{% step %} External systems monitoring these events would incorrectly believe the validator's status changed. {% endstep %} {% endstepper %}
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 event emission is placed outside the conditional that checks whether the status actually changes.
Impact
Off-chain systems that rely on events may receive misleading notifications, leading to incorrect UI or state, automation triggers, or alerting based on presumed changes.
What the attacker needed
Admin role; validator exists
The fix
The event should be emitted only when the status actually changes, and optionally the function should revert when the status is set to the same value.
How it was found
- Assume validator ID 1 exists with active set to true.
- An admin calls setValidatorStatus with the same status (true).
- The condition checking for a status change evaluates to false, so no state change occurs.
- The function still emits the ValidatorStatusUpdated event.
- External systems monitoring events incorrectly believe the status changed.
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 smart contract can announce changes by emitting an 'event', which is like a public notice that other programs listen to. Here the contract sends that notice even when nothing actually changed, so outside programs may react as if a change happened. This is a logic flaw, not a way to steal funds.
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.