Skip to content
Business logic Audit finding Beginner

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.

holydevoti0n Follow

Originally disclosed on Immunefi

Informational View original
  • 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

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:

Solidity
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:

Diff
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 %}

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

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

  1. Assume validator ID 1 exists with active set to true.
  2. An admin calls setValidatorStatus with the same status (true).
  3. The condition checking for a status change evaluates to false, so no state change occurs.
  4. The function still emits the ValidatorStatusUpdated event.
  5. 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.

More by holydevoti0n

View all

28 more disclosed reports, best first.

More from Plume Network

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.