Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(HAL-06) NO GAS FEES FOR HIGH SEQUENCE NUMBER TRANSACTIONS ALLOWS RESOURCE ABUSE #565

Closed
SA124 opened this issue Sep 11, 2024 · 1 comment
Assignees
Labels
duplicate This issue or pull request already exists Source: Audit Issues discovered by audit.

Comments

@SA124
Copy link

SA124 commented Sep 11, 2024

(HAL-06) NO GAS FEES FOR HIGH SEQUENCE NUMBER TRANSACTIONS ALLOWS RESOURCE ABUSE

Auditor: Halborn
Severity: Critical

Description
Transactions with sequence numbers significantly higher than expected can be added to the mempool and processed by the nodes. These transactions go through the initial validation and queuing phases without incurring any gas fees, despite ultimately failing during block execution due to their unexpected sequence numbers. This behavior allows for the repeated submission of such transactions without cost.

The absence of gas charges for these transactions presents a potential attack vector where a malicious actor can submit thousands of these high sequence number transactions, causing nodes to process them without incurring any costs. This behavior can lead to resource exhaustion as nodes allocate CPU, memory, and I/O resources to handle these transactions. Over time, this can degrade node performance, disrupt normal transaction processing, and potentially lead to denial-of-service (DoS) conditions. The vulnerability undermines the economic incentives designed to prevent network abuse, as it allows attackers to exploit node resources without any financial deterrent.

Proof of Concept
SETUP:
The following macro, added to the the full node's code, prints a message when a transaction is validated:

Screenshot 2024-09-11 at 1 07 55 PM

Screenshot 2024-09-11 at 1 09 26 PM

Screenshot 2024-09-11 at 1 09 48 PM
Screenshot 2024-09-11 at 1 10 09 PM

Screenshot 2024-09-11 at 1 10 43 PM
Screenshot 2024-09-11 at 1 11 28 PM

BVSS
AO:A/AC:L/AX:L/R:N/S:C/C:N/A:H/I:N/D:N/Y:H (10.0)

Screenshot 2024-09-11 at 1 13 26 PM

Recommendation
It is recommended to enforce gas fee requirements not only during the block execution phase but also during the initial transaction validation and mempool inclusion phases. This approach ensures that every transaction, regardless of whether it is ultimately successful or not, incurs a cost to the sender.

Implementing such a requirement will deter malicious actors from submitting high sequence number transactions repeatedly, as they would need to pay gas fees for each transaction. Additionally, this would align the incentives for maintaining network stability, ensuring that only legitimate transactions that contribute to the network's functionality are processed. Moreover, implementing gas fees at earlier stages of transaction processing helps to maintain the economic balance of the network and protects against denial-of-service (DoS) attacks that exploit free transaction processing.

@mzabaluev mzabaluev added Source: Audit Issues discovered by audit. duplicate This issue or pull request already exists labels Sep 12, 2024
@mzabaluev
Copy link
Collaborator

Duplicate of #409.

@mzabaluev mzabaluev closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists Source: Audit Issues discovered by audit.
Projects
None yet
Development

No branches or pull requests

3 participants