Project

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

executeMetaTransaction can DoS

Summary

Users can sign transactions to execute by calling NativeMetaTransaction::executeMetaTransaction

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

function executeMetaTransaction(
address userAddress,
bytes memory functionSignature,
bytes32 sigR,
bytes32 sigS,
uint8 sigV
) public payable returns (bytes memory) {
MetaTransaction memory metaTx = MetaTransaction({
nonce: nonces[userAddress],
from: userAddress,
functionSignature: functionSignature
});
require(
verify(userAddress, metaTx, sigR, sigS, sigV),
"Signer and signature do not match"
);
// increase nonce for user (to avoid re-use)
nonces[userAddress] = nonces[userAddress] + 1;
emit MetaTransactionExecuted(
userAddress,
msg.sender,
functionSignature,
hashMetaTransaction(metaTx)
);
// Append userAddress and relayer address at the end to extract it from calling context
(bool success, bytes memory returnData) = address(this).call{value: msg.value}(
abi.encodePacked(functionSignature, userAddress)
);
require(success, "Function call not successful");
return returnData;
}

Problem is anyone can call it on behalf of the users (i.e, front-running), causing the user's call to DoS.

Impact

Although the intended transaction will still execute, the user's call will revert causing the user to believe the transaction may have failed leading them to possible confusion and re-submitting the transaction believing it may have been unsuccessful.

Recommendations

Document this issue or ensure userAddress == msg.sender

Updates

Lead Judging Commences

0xbrivan2 Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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

Give us feedback!