libp2p / libp2p/rust-libp2p

identify protocol could close connection if remote peer sends invalid public key

Open
#5,713 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
5.6k
Forks
1.3k
Avg merge
8h 47m
Merged PRs (30d)
19

Description

Description

Remote peer shouldn't ever be providing a public key that doesn't match their peer ID, in this case could close the connection

I haven't tested but it looks like this is what js-libp2p does, for example (https://github.com/libp2p/js-libp2p/blob/d19974d93a1015acfca95c2155dbcffc5fd6a6c0/packages/protocol-identify/src/identify.ts#L106-L108)

Motivation

See discussion at * https://github.com/libp2p/rust-libp2p/pull/5707#discussion_r1866001556

Current Implementation

identify protocol connection to remote peer stays open

Are you planning to do it yourself in a pull request ?

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 tracing the Rust identify protocol's handling of the remote public key and peer ID, then review the linked discussion and the referenced js-libp2p behavior. Confirm how an invalid key is currently handled and identify the existing connection-close path. Done means a mismatched public key causes the identify connection to close, with coverage in the relevant existing tests if available.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.