The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: low
Invalid

Event Log Poisoning in `SmartVaultV3`

Summary

A lot of functions in the contracts miss zero value checks. In case of the remove collateral functions inside the SmartVaultV3 contract, this can be misused to emit events for zero value removals.

Vulnerability Details

Here we can see the functions used to remove collateral out of a vault:

function removeCollateralNative(uint256 _amount, address payable _to) external onlyOwner {
require(canRemoveCollateral(getTokenManager().getToken(NATIVE), _amount), UNDER_COLL);
(bool sent,) = _to.call{value: _amount}("");
require(sent, "err-native-call");
emit CollateralRemoved(NATIVE, _amount, _to);
}
function removeCollateral(bytes32 _symbol, uint256 _amount, address _to) external onlyOwner {
ITokenManager.Token memory token = getTokenManager().getToken(_symbol);
require(canRemoveCollateral(token, _amount), UNDER_COLL);
IERC20(token.addr).safeTransfer(_to, _amount);
emit CollateralRemoved(_symbol, _amount, _to);
}
function removeAsset(address _tokenAddr, uint256 _amount, address _to) external onlyOwner {
ITokenManager.Token memory token = getTokenManager().getTokenIfExists(_tokenAddr);
if (token.addr == _tokenAddr) require(canRemoveCollateral(token, _amount), UNDER_COLL);
IERC20(_tokenAddr).safeTransfer(_to, _amount);
emit AssetRemoved(_tokenAddr, _amount, _to);
}

As we can see, there are no zero value checks for the _amount parameter. This means that these functions can be called with a zero value, which will result in an event being emitted for a zero value removal. Which can be used as griefing attack to spam the event log and could also lead to frontend bugs depending on the implementation. In the protocol's frontend, as well as third party frontends relying on these events.

Impact

Event log poisoning and possible frontend bugs.

Recommendations

Add zero value checks to the functions.

Updates

Lead Judging Commences

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

informational/invalid

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.