sherlock-2025-06-symbiotic-relay-m05
[M-05] Changing the epoch duration will completely break the vault and the slashers
Summary
기간 설정을 변경할 때, Epoch, 슬래시, Veto 기간의 아귀가 맞는지 확인하지 않는다. 이로 인해 슬래시가 불가할 수 있다.
Keyword
input validation
Vulnerability
OpNetVaultAutoDeploy 는 BASE_VAULT_VERSION 과 TOKENIZED_VAULT_VERSION 버전 볼트를 배포할 수 있다. 또한, 지원하는 슬래셔는 SlasherType.INSTANT 와 SlasherType.VETO 타입이다. Instant 타입 슬래셔는 이번 Epoch에서 발생한 슬래시 이벤트를 즉시 적용한다. Veto 타입은 슬래시를 요청한 후 일정 기간동안 슬래시를 반대할 수 있는 타입이다.
OpNetVaultAutoDeploy의 설정을 변경할 때, _validateConfig 에서 새로운 config.epochDuration 이 유효한 값인지 확인한다. 하지만 VotingPowerProvider의 slashingWindow가 새로운 config.epochDuration 이하인 지는 확인하지만, 슬래셔의 vetoDuration 은 고려하지 않는다.
function _validateConfig(
IOpNetVaultAutoDeploy.AutoDeployConfig memory config
) public view {
if (config.collateral == address(0)) {
revert IOpNetVaultAutoDeploy.OpNetVaultAutoDeploy_InvalidCollateral();
}
if (config.epochDuration == 0) {
revert IOpNetVaultAutoDeploy.OpNetVaultAutoDeploy_InvalidEpochDuration();
}
uint48 slashingWindow = IVotingPowerProvider(address(this)).getSlashingWindow();
@> if (config.epochDuration < slashingWindow) {
revert IOpNetVaultAutoDeploy.OpNetVaultAutoDeploy_InvalidEpochDuration();
}
if (!config.withSlasher && slashingWindow > 0) {
revert IOpNetVaultAutoDeploy.OpNetVaultAutoDeploy_InvalidWithSlasher();
}
if (!config.withSlasher && config.isBurnerHook) {
revert IOpNetVaultAutoDeploy.OpNetVaultAutoDeploy_InvalidBurnerHook();
}
}슬래시는 동일 또는 바로 다음 Epoch 까지는 완료되어야 한다. 하지만 설정을 변경하며 기간이 적절한 지 확인하지 않으므로, 슬래시 가능 기간과 Epoch 기간이 맞지 않게 설정될 수 있다. 가능한 기간이 서로 맞지 않으면 슬래시가 불가할 수 있다.
function onSlash(uint256 amount, uint48 captureTimestamp) external nonReentrant returns (uint256 slashedAmount) {
if (msg.sender != slasher) {
revert NotSlasher();
}
uint256 currentEpoch_ = currentEpoch();
@> uint256 captureEpoch = epochAt(captureTimestamp);
@> if ((currentEpoch_ > 0 && captureEpoch < currentEpoch_ - 1) || captureEpoch > currentEpoch_) {
revert InvalidCaptureEpoch();
}
...
}Impact
Epoch 기간과 슬래시 기간, Veto 기간의 범위가 불일치한다. 슬래시가 실패하거나 불가하게 된다. 잘못된 설정의 볼트가 배포되거나, 오퍼레이터 등록 기능이 DoS 될 수 있다(볼트 배포에 실패하기 때문에).
Mitigation
OpNetVaultAutoDeploy 설정 변경시 확인을 추가한다. 각 기간의 아귀가 맞는지 확인한다.
tags: bughunting, symbiotic, smart contract, solidity, severity medium, lack-of-input-validation-vul