[Security] Fix HIGH vulnerability: V-001 #10564
Open
+93
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Security Fix
This PR addresses a HIGH severity vulnerability detected by our security scanner.
Security Impact Assessment
on_requestfunction handler, likely requiring integration of a Rust crate for throttling and potential refactoring of the client's proof generation logic to avoid breaking changes; this demands moderate testing to ensure compatibility with Polkadot's network protocols and dependencies.Evidence: Proof-of-Concept Exploitation Demo
This demonstration shows how the vulnerability could be exploited to help you understand its severity and prioritize remediation.
How This Vulnerability Can Be Exploited
The vulnerability in the light client request handler allows an attacker to overwhelm a Polkadot light client node by sending a high volume of requests that trigger computationally expensive operations, such as generating execution proofs via
self.client.execution_proof, without any rate limiting or queuing mechanisms. This can be exploited by crafting and flooding network requests to the light client's peer-to-peer interface, exhausting CPU, memory, and database resources, rendering the node unresponsive. In the context of the Polkadot network, this targets light clients that rely on Substrate's libp2p-based networking for handling requests from peers or RPC calls.The vulnerability in the light client request handler allows an attacker to overwhelm a Polkadot light client node by sending a high volume of requests that trigger computationally expensive operations, such as generating execution proofs via
self.client.execution_proof, without any rate limiting or queuing mechanisms. This can be exploited by crafting and flooding network requests to the light client's peer-to-peer interface, exhausting CPU, memory, and database resources, rendering the node unresponsive. In the context of the Polkadot network, this targets light clients that rely on Substrate's libp2p-based networking for handling requests from peers or RPC calls.To demonstrate this exploit in a controlled, test environment (e.g., a local Polkadot development setup), an attacker would first need to run a light client instance from the repository's Substrate codebase. The exploit involves using a script to simulate multiple peers sending continuous requests for execution proofs, leveraging the repository's network protocol (based on libp2p and Substrate's light client RPC). Note that this requires access to the network (e.g., as a connected peer) and assumes the light client is exposed or reachable; in production, light clients are typically behind firewalls, but misconfigurations or public nodes could expose them.
Exploitation Impact Assessment
Vulnerability Details
V-001substrate/client/network/light/src/light_client_requests/handler.rson_requestfunction in the light client request handler processes incoming network requests without any apparent rate limiting, request queuing, or resource management controls. Each request directly triggers a call toself.client.execution_proof, which can be a computationally expensive operation involving database access and cryptographic proof generation.Changes Made
This automated fix addresses the vulnerability by applying security best practices.
Files Modified
substrate/client/network/light/src/light_client_requests/handler.rsVerification
This fix has been automatically verified through:
🤖 This PR was automatically generated.