Closed 0xKitsune closed 1 year ago
beneficiary
is initially set as the admin and can only be updated by the admin, so this issue can be mitigated by making sure the operator and admin are properly separated.
This beneficiary
issue was created because of 2 possibilities of locked eth.
if MevEthShareVault is upgraded it will not be authorised any longer to call grantRewards
/// @notice Grants rewards from the MevEthShareVault, updating the fraction.elastic.
/// @dev Before updating the fraction, the withdraw queue is processed, which pays out any pending withdrawals.
/// @dev This function is only callable by the MevEthShareVault.
function grantRewards() external payable {
if (!(msg.sender == address(stakingModule) || msg.sender == mevEthShareVault)) revert MevEthErrors.InvalidSender();
/// @dev Note that while a small possiblity, it is possible for the MevEthShareVault rewards + fraction.elastic to overflow a uint128.
/// @dev in this case, the grantRewards call will fail and the funds will be secured to the MevEthShareVault.beneficiary address.
fraction.elastic += uint128(msg.value);
emit Rewards(msg.sender, msg.value);
}
Is the sender check necessary for grantRewards
? Perhaps not. Does it matter who grants rewards? If there is a zero msg.value check I can't see any attack vector.
In the case above, beneficiary
can be safely removed.
@0xKitsune
Status
Reported
Type
Vulnerability
Severity
High
Code Snippet:
Remediation
Description