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.
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.
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.
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.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.