DOS+griefing attack for AuraVestedEscrow contract by calling fund() because it does not have access control and anyone can call it and initialize contract with wrong parameters #305
Labels
bug
Something isn't working
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
G (Gas Optimization)
Lines of code
https://github.com/code-423n4/2022-05-aura/blob/4989a2077546a5394e3650bf3c224669a0f7e690/contracts/AuraVestedEscrow.sol#L96-L110
Vulnerability details
Impact
There is no access control in
fund()
and anyone can call it. This function is only is callable one time for a contract and initializes the contract. An attacker can call this function of any deployed contract exactly after deployment with dummy parameters and make contract to become useless. it will cause deployer to pay deployment gas fee and even the impact is larger if the address of this contract has been used in other contracts.Proof of Concept
This is
fund()
code inAuraVestedEscrow
:As you can see, deployer needs to call this contract after deployment and this function is only callable one time. but attacker can watch contract deployments and immediately call
fund([],[])
and initiate deployed contract with dummy parameters and make deployer lose deployment gas paid. So attacker can completely block usage of this contract for all deployments.Tools Used
VIM
Recommended Mitigation Steps
Check that
msg.sender
infund
isowner
or other mechanism that prevent hacker from performing DOSThe text was updated successfully, but these errors were encountered: