Project

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

Missing Validation for functionSignature in executeMetaTransaction

Summary

The executeMetaTransaction function in the contract lacks thorough and strict validation of the functionSignature passed in. This could allow an attacker to provide an invalid or malicious functionSignature, leading to the execution of unwanted functions or attacks on the contract. Without a mechanism to validate the functionSignature, security vulnerabilities may arise, causing harm to the system or users.

Vulnerability Details

In the executeMetaTransaction function, the functionSignature is passed in without any validation of its validity. Specifically, the functionSignature is concatenated with the user's address in the call instruction:

https://github.com/Cyfrin/2024-11-one-world/blob/main/contracts/meta-transaction/NativeMetaTransaction.sol#L33-L68

(bool success, bytes memory returnData) = address(this).call{value: msg.value}(
abi.encodePacked(functionSignature, userAddress)
);

This means that an attacker could send any value for the functionSignature, including malicious commands or requests to call unwanted functions within the contract. Although the contract executes the call with the functionSignature, there is no mechanism in place to validate the functionSignature before execution.

Impact

Without thorough validation of the functionSignature, an attacker could easily call unwanted functions.

Tools Used

Manual

Recommendations

Add an additional layer of verification to ensure that the functionSignature only contains valid signatures of functions within the contract.

Updates

Lead Judging Commences

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.