Project

One World
NFTDeFi
15,000 USDC
View results
Submission Details
Severity: medium
Invalid

Calling external contract without specifying gas constraints can result in DOS attack and funds drain

Summary

The function does not specify gas constraints for the external call. An attacker could exploit this by submitting a high gas call, potentially draining contract funds or causing an out-of-gas issue.

Vulnerability Details

The function MembershipFactory::callExternalContract uses Solidity's call method to make an external call to another contract.

(bool success, bytes memory returndata) = contractAddress.call{value: msg.value}(data);

However, it does not specify a gas limit for the external call. The lack of gas limitations means that an attacker can send a malicious transaction with a large gas amount, leading to draining the contract’s balance or causing an out-of-gas exception, this could cause a denial of service (DoS) for users trying to call this function.

Impact

  • Denial of Service (DoS): If the attacker uses excessive gas, the contract may run out of gas or be unable to complete the call, causing the function to fail.

  • Funds Drain: If the external contract requires excessive gas or has been designed maliciously, it could consume more gas than expected, leading to funds being spent on gas and reducing the available balance for legitimate users.

Tools Used

  • Manual analysis

Recommendations

To mitigate this issue, set a gas limit when calling an external contract, ensuring that calls are predictable and within an acceptable range.

(bool success, bytes memory returndata) = contractAddress.call{value: msg.value, gas: 50000}(data);

This will prevent excessive gas consumption.

Updates

Lead Judging Commences

0xbrivan2 Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
0xbrivan2 Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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