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

Potential Denial-of-Service (DoS) Attack

Summary

The _consumeMessageStarknet function is vulnerable to denial-of-service (DoS) attacks due to its reliance on external contract checks for message consumability. If an unconsumable message is encountered, the function will revert, preventing legitimate users from interacting with the contract. This issue poses a significant risk, as it could disrupt the contract's normal operations and block users from performing withdrawals or other important actions.

Vulnerability Details

The _consumeMessageStarknet function is responsible for consuming a message from the Starknet Core contract. This function relies on the external contract IStarknetMessaging to check if a message is consumable. If the message is not consumable (e.g., it has already been consumed, the message doesn't exist, or any other condition causes the external contract to revert), the function will revert, halting execution. This behavior could be exploited by malicious actors who intentionally create or manipulate unconsumable messages, causing the function to fail repeatedly. As a result, legitimate users attempting to withdraw tokens or interact with the contract could be blocked, leading to a denial-of-service (DoS) attack.

Impact

It could effectively render the contract unusable for all users. If an unconsumable message is repeatedly processed, the contract will revert each time, preventing legitimate withdrawals or message consumption. This would disrupt the normal operations of the contract, leading to a complete denial of service for affected users. Additionally, it could erode trust in the contract and its functionality, as users may experience repeated transaction failures without a clear understanding of the underlying cause.

Tools Used

Recommendations

Graceful Error Handling: Implement a try-catch block in the _consumeMessageStarknet function to handle failures without reverting, allowing other transactions to proceed and isolating problematic messages

Pre-Validation of Messages: Add checks to validate messages before consuming them, ensuring they haven't been previously consumed or tampered with, reducing the likelihood of encountering unconsumable messages.

Updates

Lead Judging Commences

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

Support

FAQs

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