Lack of signedPeerRecord Validation in C++ IdentifyMessageProcessor Leads to Address Injection
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 492
- Forks
- 130
- PR merge metrics
- No merged PRs in 30d
Description
Summary
The C++ implementation of libp2p’s Identify protocol (IdentifyMessageProcessor) does not validate or process the signedPeerRecord field in Identify messages.
This allows malicious peers to inject or forward third-party signed peer records, leading to address poisoning and potential identity spoofing, similar to previously fixed vulnerabilities in Go and JS libp2p implementations.
Expected behavior
When an Identify message includes a signedPeerRecord:
The envelope signature must be verified.
The public key inside the envelope must derive a PeerId equal to the connection’s remotePeerId.
The PeerRecord.peerId must also match this derived PeerId.
Only if all checks succeed should the certified addresses be accepted and stored.
Actual behavior
The current C++ code (IdentifyMessageProcessor::identifyReceived) only verifies the publicKey field.
It does not parse or validate signedPeerRecord.
A malicious peer can forward another peer’s valid signed record, causing addresses of an unrelated peer to be stored.
Relevant log output
Possible Solution
Go libp2p issue: Identity protocol accepts signed peer records without validation
Go libp2p fix: x
The revelent_file
Version
No response
Would you like to work on fixing this bug ?
Yes
Contributor guide
No contributing guide indexed for this repository
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 with src/protocol/identify/identify_msg_processor.cpp, especially IdentifyMessageProcessor::identifyReceived, and compare the referenced Go libp2p fix for validation behavior. Done means signedPeerRecord envelopes are verified, both PeerId relationships are checked against the connection and record, and certified addresses are accepted only when all checks succeed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- networking, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100