docs: add security considerations and threat model for Partial Messages extension#15
Open
adarsh-7-satyam wants to merge 1 commit into
Open
Conversation
…es extension Signed-off-by: Adarsh Satyam <adarsh5.satyam@gmail.com>
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.
Description
The Partial Messages extension for Gossipsub 1.4 introduces a fundamentally different message propagation model where peers exchange fragments of large payloads rather than complete messages. While this dramatically reduces bandwidth in high-throughput environments like Ethereum's Data Availability Sampling, it also introduces an entirely new class of attack vectors that do not exist in standard Gossipsub. The current
partial-messages.mdspecification addresses security in a single paragraph, advising implementations to "limit peer-initiated state" without specifying how or what limits to apply. This leaves every implementation team — frompy-libp2ptonim-libp2p— to independently discover and mitigate these threats, often only after encountering them in production.Problem
There is no formal threat model for the Partial Messages extension anywhere in the specification repository. The existing Gossipsub security mechanisms defined in
gossipsub-v1.1.md(Peer Scoring, Spam Caps) andred.md(Random Early Drop) were designed for full message propagation and do not account for the new state management challenges introduced by groupID tracking, partsMetadata exchange, and application-layer reassembly.Changes Made
Added a new document
pubsub/gossipsub/security-considerations.mdthat provides a comprehensive security and threat model for the Partial Messages extension. The document is structured as follows:Existing Security Foundations — Enumerates the existing v1.1 and v1.2 security mechanisms that implementations MUST maintain when adding Partial Messages support, including Peer Scoring (P4, P7), RED, control message caps, IDONTWANT limits, and PRUNE backoff.
Threat Model — Identifies and details six new attack vectors specific to the Partial Messages extension:
Application-Library Interface Security Requirements — Since partsMetadata and partialMessage are application-defined opaque bytes, the Gossipsub library cannot validate them directly. This section specifies that the interface MUST allow the application to signal P7 Behavioural Penalties back to the library, drawing on BitTorrent piece hashes as prior art for part integrity verification.
Implementation Checklist — An actionable checklist of seven security requirements that implementations MUST verify before deploying Partial Messages support.
How It Solves The Problem
By providing a shared formal threat model with concrete mitigations, this document gives all Gossipsub implementation teams a common reference for building secure Partial Messages support. Rather than each team discovering these vulnerabilities independently, they can use this document as a security review checklist during implementation and audit.
Impact
py-libp2pandnim-libp2pRelated Issue
Closes #14