code-423n4 / 2021-04-vader-findings

1 stars 0 forks source link

calculations of upgradedAmount is not overflow protected #277

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

paulius.eth

Vulnerability details

Impact

As contract Vether4 is using pragma solidity 0.6.4; SafeMath is not enabled by default, thus making this check inside function distribute avoidable (overflow): upgradedAmount += ownership[i]; require(upgradedAmount <= maxEmissions, "Must not send more than possible"); Of course, this function can only be called by the deployer (who is later expected to call purgeDeployer) so the issue is only theoretical.

Recommended Mitigation Steps

Use SafeMath here or just be informed about this theoretical issue.