
Cloud Vulnerability DB
A community-led vulnerabilities database
Affected: PyPI libp2p >= 0.3.0, <= 0.8.1: every release since the QUIC transport first shipped in 0.3.0, including the latest. QUIC transport only; TLS-over-TCP, secio and Noise are NOT affected.
Patched: not yet released. The fix is in the private advisory fork, PR #1 (https://github.com/libp2p/py-libp2p-ghsa-hrfr-7729-443m/pull/1).
Severity: Critical, CVSS:3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N (9.1). CWE-347, CWE-295, CWE-252.
Vulnerable function: PeerAuthenticator.verify_peer_certificate (libp2p/transport/quic/security.py).
The QUIC transport's libp2p-TLS peer verification never actually checks the proof-of-possession (PoP) signature in a remote peer's certificate. The signature is "verified" with a call whose return value is discarded, so an invalid signature passes. An attacker can present a TLS certificate that embeds any victim's libp2p public key without owning the victim's private key, and py-libp2p will accept the connection as that victim.
TLS-over-TCP, secio, and Noise are not affected — they perform the equivalent check correctly. QUIC is the only affected transport. QUIC is opt-in (new_host(enable_quic=True) / an explicit quic-v1 listen address).
First verified at py-libp2p main @ 79985430 (package 0.7.0), Python 3.13.15, aioquic 1.3.0. Re-confirmed 2026-11-15 on main @ 55965649 (0.8.1); the vulnerable try/except is still present. The same code is in every tagged release from v0.3.0 to v0.8.1.
PeerAuthenticator.verify_peer_certificate in libp2p/transport/quic/security.py builds the PoP payload and calls public_key.verify(...) inside a try/except, expecting a bad signature to raise:
signature_payload = b"libp2p-tls-handshake:" + cert_public_key_bytes
try:
public_key.verify(signature_payload, signature)
except Exception as e:
raise QUICPeerVerificationError(f"Invalid signature in libp2p extension: {e}")But public_key is a libp2p PublicKey, whose verify() returns a bool and does not raise on an invalid signature (libp2p/crypto/keys.py:59 abstract -> bool; libp2p/crypto/ed25519.py:46-51 catches BadSignatureError and returns False; secp256k1/rsa/ecdsa equivalently). On a bad signature verify() returns False, the try completes without raising, the return value is discarded, and verification falls through to success. The PoP check is a no-op.
Peer identity on QUIC is derived from the public key in the certificate's libp2p extension (ID.from_pubkey(public_key)), gated on the PoP. With the PoP disabled:
None (libp2p/transport/quic/listener.py:1094 -> connection.py:681 verify_peer_identity(cert, None)), so py accepts whatever identity the certificate claims. An attacker dials a py-libp2p QUIC listener with a cert embedding any target's public key and a bogus PoP; the listener believes the peer is that target. Defeats authorization/connection-gating keyed on peer ID.V it sets expected_peer_id = V and checks derived == expected. The attacker embeds V's public key so the check passes, while the channel is secured with the attacker's own certificate key. An attacker who receives the dial (DHT/peer-record poisoning, DNS, on-path, malicious relay/rendezvous) terminates the "authenticated" connection as V and reads/writes all traffic.
In both cases the attacker never possesses the victim's libp2p private key.A self-contained script runs the real production verifier (QUICTLSConfigManager.verify_peer_identity, no mocks) with a forged certificate embedding the victim's public key but a PoP signed by an unrelated throwaway key; the vulnerable build accepts it as the victim. Available privately on request along with a patch branch.
Check the boolean return, matching the already-correct TLS-over-TCP code (libp2p/security/tls/certificate.py:356):
if not public_key.verify(signature_payload, signature):
raise QUICPeerVerificationError(
"Invalid signature in libp2p extension: "
"proof-of-possession does not match the embedded public key"
)Fix and regression test are in the private fork: https://github.com/libp2p/py-libp2p-ghsa-hrfr-7729-443m/pull/1 (branch advisory-fix-1, commit cc56123a). tests/core/transport/quic/test_quic_inbound_auth.py::test_verify_rejects_forged_proof_of_possession fails without the fix and passes with it. tests/core/transport/quic and tests/core/security: 326 passed, 2 skipped. ruff, mypy and pyrefly are clean. Earlier, valid go-libp2p -> py /quic-v1 interop also still succeeded with the fix.
Until patched, do not enable the QUIC transport (enable_quic=False / omit quic-v1 listen addresses); use TLS-over-TCP or Noise.
"libp2p-tls-handshake:" || certPubKey): https://github.com/libp2p/specs/blob/master/tls/tls.mdlibp2p/security/tls/certificate.py:356Source: NVD
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."