NFTBridge
60,000 USDC
View results
Submission Details
Severity: medium
Invalid

Issue with Zero `msg.value` in sendMessageToL2

Summary

In the depositTokens function, the sendMessageToL2 call allows a user to send a message with a msg.value of 0, which might lead to unexpected behavior if a non-zero msg.value is required for gas.

Vulnerability Details

IStarknetMessaging(_starknetCoreAddress).sendMessageToL2{value: msg.value}(
snaddress.unwrap(_starklaneL2Address),
felt252.unwrap(_starklaneL2Selector),
payload
);

There is no check to ensure that msg.value is greater than 0. If a non-zero msg.value is required to cover gas costs or other expenses, this could lead to failed transactions or other issues.

Impact

Users might unintentionally send a transaction with insufficient funds, leading to failed L2 messaging and potential loss of user funds due to gas costs on L1.

Tools Used

Manual code review.

Recommendations

Implement a check to ensure that msg.value is appropriate for the transaction, or provide guidance to users on the required msg.value for successful execution.

Updates

Lead Judging Commences

n0kto Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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