fix: bound remote pubsub subscriptions to prevent memory exhaustion#1350
Open
acul71 wants to merge 3 commits into
Open
fix: bound remote pubsub subscriptions to prevent memory exhaustion#1350acul71 wants to merge 3 commits into
acul71 wants to merge 3 commits into
Conversation
Fix GHSA-4f8r-922h-2vgv by enforcing inbound RPC size and subscription limits, tracking per-peer subscription counts, and deleting empty topic entries from peer_topics on unsubscribe and disconnect. Fixes #1349 Co-authored-by: Cursor <cursoragent@cursor.com>
Clear peer_topics on Pubsub shutdown, add optional allowed_topics filter, and expand regression tests for dead-peer teardown, blacklist cleanup, RPC boundary cases, and idempotent resubscribe. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
Status update — GHSA-4f8r-922h-2vgv / #1349cc @seetadev @sumanjeet0012 for review — this addresses the GossipSub subscription-flood memory exhaustion pattern reported across the libp2p ecosystem (js GHSA-4f8r-922h-2vgv, go go-libp2p-pubsub#710, cpp cpp-libp2p#349). What’s been accomplishedCore mitigations (shared
Tests —
CI — What’s still missing / out of scope for this PR
Ecosystem parity (rough)
Happy to adjust default limits, add scorer penalties, or scope a follow-up PoC test if maintainers prefer. Thanks for any guidance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
peer_topicsentries on unsubscribe and peer removal (disconnect / blacklist).Fixes #1349
Related
Test plan
pytest tests/core/pubsub/test_pubsub_subscription_limits.py -vpytest tests/core/pubsub/test_pubsub.py::test_handle_subscription -vpytest tests/core/pubsub/test_pubsub.py::test_peers_subscribe -vmake lint && make typecheck && make test && make linux-docsMade with Cursor