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

P2P Sybil attack #2054

Open
harmony-ek opened this issue Jan 8, 2020 · 1 comment
Open

P2P Sybil attack #2054

harmony-ek opened this issue Jan 8, 2020 · 1 comment
Labels
design Design and architectural plans/issues libp2p Peer to Peer networking security Security-related issues

Comments

@harmony-ek
Copy link
Contributor

Summary

libp2p peer ID is based only on RSA public key. This allows an attacker to create unlimited number of nodes on a single machine (same IP address) and use these nodes to monopolize the incoming/outgoing connections of victim nodes.

Current Design

Incoming connections are not checked against IP-based duplicity.

Problems

An attacker controlling a host may create a large number of libp2p peer IDs and create connection to a victim host under those peer IDs. This leads to a few problems:

  • A victim host may run out of available file descriptors, leading to denial-of-service.
  • Since libp2p pubsub uses a fixed number of outbound connections for outbound message propagation (6-8 by default), if the Sybil peers advertise critical topics (such as shard topics) the probability of the victim node choosing one of the sound, non-Sybil nodes for outbound messaging reaches zero.

Proposal

Gate incoming connections by their source IP address, allowing only one or two from each source IP and dropping others.

Note: This may cause it difficult or impossible to run multiple nodes behind a NAT gateway which maps the nodes to the same public IP address. We may need to add support for NAT whitelisting as a configuration policy variable.

@harmony-ek harmony-ek added design Design and architectural plans/issues libp2p Peer to Peer networking security Security-related issues labels Jan 8, 2020
@LeoHChen
Copy link
Contributor

This is a valid risk, converting it to a bounty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Design and architectural plans/issues libp2p Peer to Peer networking security Security-related issues
Projects
None yet
Development

No branches or pull requests

2 participants