Certified Address Hijacking in libp2p PeerStore
The @libp2p/peer-store package incorrectly validates PeerRecord envelopes, allowing attackers to inject fraudulent, certified addresses into the records of victim peers.
CVE search metadata
CVE search record: CVE-2026-86039. Severity: high. CVSS: 8.2. KEV: no. Product: @libp2p/peer-store (>= 8.0.0, < 12.0.24). Brief: Certified Address Hijacking in libp2p PeerStore. Brief link: https://feed.craftedsignal.io/briefs/2026-09-libp2p-peer-store-hijack/
The @libp2p/peer-store package contains a critical logic error in the consumePeerRecord function, identified as CVE-2026-86039. The vulnerability arises because the package verifies the cryptographic signature of the PeerRecord envelope but fails to verify that the signer of that envelope matches the PeerId embedded within the payload.
An attacker can generate a signed PeerRecord using their own private key but specify the PeerId of a victim in the payload. When processed by a vulnerable node, the library treats the payload as authentic because the envelope signature is technically valid (signed by the attacker). Consequently, the node stores attacker-controlled multiaddrs as 'certified' addresses for the victim peer. Since libp2p connection logic prioritizes certified addresses during dialing, this vulnerability allows for address-book poisoning, dial redirection, and reachability disruption. This affects @libp2p/peer-store versions 8.0.0 through 12.0.23.
Attack Chain
- Attacker generates a legitimate libp2p cryptographic key pair.
- Attacker crafts a
PeerRecordobject containing the victim'sPeerIdand the attacker's own malicious multiaddrs. - Attacker signs this
PeerRecordusing their own private key, creating a validRecordEnvelope. - Attacker transmits the forged envelope to a target node, typically through peer discovery protocols like GossipSub Peer Exchange (PX).
- The target node's
consumePeerRecordfunction extracts thePeerIdfrom the envelope signature and validates the signature successfully. - The target node fails to compare the signer's identity against the
PeerRecord.peerIdfield in the payload. - The target node's
peerStore.patchmethod commits the forged addresses to its local datastore, marking them asisCertified: trueunder the victim's identity. - Future connection attempts by the target node to the victim peer are redirected to the attacker's infrastructure or result in connection failure.
Impact
Successful exploitation results in the poisoning of the target's peer-store cache. Because certified addresses are highly prioritized by libp2p connection logic, legitimate traffic intended for the victim peer is redirected to attacker-controlled endpoints. This can disrupt network connectivity, prevent legitimate peer communication, and facilitate further reconnaissance or man-in-the-middle attacks on the application layer. Thousands of decentralized applications and infrastructure nodes relying on libp2p for peer-to-peer networking are potentially affected.
Recommendation
Prioritized, concrete actions for engineering and security teams:
- Upgrade
@libp2p/peer-storeto version 12.0.24 or later to implement the required PeerId/signer identity invariant. - Audit existing PeerStore datastores for unexpected or unauthorized certified addresses associated with high-value peer IDs if the node has been exposed to untrusted peer records.
- Implement strict peer-to-peer connection validation logic to ensure that connection upgrades and identity handshakes are not solely reliant on certified peer records stored in the local cache.
Immediate actions
Upgrade @libp2p/peer-store to 12.0.24.
Mitigations
Upgrade @libp2p/peer-store to version 12.0.24 or later.
CVE-2026-86039