Strict checking for '/multistream/1.0.0' prefix in remote peer protocol negotiation is missing when rust-libp2p acts as dialer
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 5.6k
- Forks
- 1.3k
- Avg merge
- 8h 47m
- Merged PRs (30d)
- 19
Description
Summary
When rust-libp2p acts as the connection initiator (dialer), it appears that it does not strictly check whether the remote peer's (responder) protocol negotiation message always starts with "/multistream/1.0.0". From the implementation here, the code does not add a tag to show that "/multistream/1.0.0" has been sent from the responder; instead, it just continues with "AwaitProtocol". I also tested this and found that it does not check for "/multistream/1.0.0" during any of the protocol negotiation stages.
Expected behavior
When rust-libp2p acts as the connection initiator (dialer), it should strictly check whether the remote peer's (responder) protocol negotiation message always starts with "/multistream/1.0.0".
Actual behavior
When rust-libp2p acts as the connection initiator (dialer), it does not strictly check whether the remote peer's (responder) protocol negotiation message always starts with "/multistream/1.0.0".
Relevant log output
No response
Possible Solution
No response
Version
No response
Would you like to work on fixing this bug ?
Yes
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in misc/multistream-select/src/dialer_select.rs at lines 179-195 and trace the dialer’s protocol-negotiation stages. Confirm that the responder’s message is rejected unless it starts with /multistream/1.0.0, then add or update coverage for the dialer path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100