code-423n4 / 2024-09-karak-mitigation-findings

0 stars 0 forks source link

H-04 MitigationConfirmed #14

Open c4-bot-6 opened 2 months ago

c4-bot-6 commented 2 months ago

Lines of code

Vulnerability details

C4 Issue:

H-04: https://github.com/code-423n4/2024-07-karak-findings/issues/4

Comments

Before mitigation if the requestSlashing() was called in the last 2 days of a vault unstake request (during MIN_STAKE_UPDATE_DELAY), finalizeSlashing() can be called on a vault even after its operator has unregistered from the DSS with unregisterOperatorFromDSS(). This break one of the main invariants of the protocol.

Mitigation

FIX-01 FIX-02 The first mitigation ensures that checkIfOperatorIsRegInRegDSS() is called before finalizeSlashing() preventing DSS from slashing an unregistered operator. The second mitigation modifies finalizeSlashing() function to skip any vaults that are not staked to the DSS. Both mitigations resolve the issue.

Conclusion

LGTM

c4-judge commented 2 months ago

MiloTruck marked the issue as satisfactory

c4-judge commented 2 months ago

MiloTruck marked the issue as confirmed for report