libp2p / libp2p/py-libp2p

py-libp2p lacks resource management and is vulnerable to resource exhaustion attacks

Open
#572 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
624
Forks
256
Avg merge
1d 34m
Merged PRs (30d)
47

Description

Summary

Unlike go-libp2p v0.18.0+, py-libp2p does not implement a resource manager (rcmgr). This leaves it vulnerable to targeted resource exhaustion, such as:

  1. Unlimited stream creation (e.g. via multistream-select)

  2. Excessive memory use through malformed payloads

  3. Sybil-based connection flooding

Expected behavior

Expected Behavior
1.Enforced limits on streams, connections, memory, and peers

  1. Configurable (and optionally autoscaling) resource limits

  2. Optional integration with metrics and peer blocking

Actual behavior

Actual Behavior
No resource manager in place

No limits or backpressure on connections/streams

No way to detect or block abusive peers

High DoS risk in adversarial environments

Relevant log output

Possible Solution

Enforced limits on streams, connections, memory, and peers
There is the similar problem
There is the similart fix logic

Environment

Would you like to work on fixing this bug ?

Maybe

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing py-libp2p's current connection and stream handling with the go-libp2p v0.18.0+ resource manager, the linked security advisory, and the referenced fix commit. Done means resource limits and backpressure cover streams, connections, memory, and peers, with the requested configurability and optional metrics or peer-blocking integration addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking, security
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.