The vulnerability allows an attacker to cause high CPU usage by sending specially crafted p2p messages, leading to a denial-of-service. The root cause is the computationally expensive KZG verification process for blob transactions. The analysis of the patch abeb78c647e354ed922726a1d719ac7bc64a07e2 reveals the following:
-
Expensive Computations: The functions validateBlobSidecarLegacy and validateBlobSidecarOsaka in core/txpool/validation.go perform the heavy lifting of KZG proof verification. An attacker can craft invalid proofs that are expensive to verify, consuming significant CPU time.
-
Ineffective Rate Limiting: The TxFetcher.Enqueue method in eth/fetcher/tx_fetcher.go is responsible for processing transactions received from peers. Prior to the patch, it would process an entire batch of transactions from a peer without stopping, even if some transactions failed verification. This allowed an attacker to flood the node with malicious transactions.
-
The Fix: The patch introduces a new specific error, ErrKZGVerificationError, which is now returned by the validation functions. The TxFetcher.Enqueue method is updated to check for this specific error. If it's encountered, the function immediately stops processing further transactions from that peer and flags the peer for disconnection. This effectively mitigates the DoS attack by quickly identifying and banning malicious actors.
A secondary fix was identified in PrivateKey.Decrypt within crypto/ecies/ecies.go, where a message length check was made more robust. This was likely part of the same set of DoS fixes and addresses a potential issue with malformed encrypted messages.