Vulnerability DatabaseGHSA-hrfr-7729-443m

GHSA-hrfr-7729-443m: 
Python vulnerability analysis and mitigation

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).

Summary

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.

Root cause

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.

Impact

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:

  1. Impersonation to a listener (no network interception needed). Inbound QUIC connections have expected peer ID 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.
  2. MITM of an authenticated dial (on-path / address control). When py dials 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.

Proof of concept

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.

Patch

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.

Workaround

Until patched, do not enable the QUIC transport (enable_quic=False / omit quic-v1 listen addresses); use TLS-over-TCP or Noise.

References


Source: NVD

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-hrfr-7729-443mCRITICAL9.1
  • Python logoPython
  • libp2p
NoNoNov 15, 2026
GHSA-p93c-6m6f-h588MEDIUM6.5
  • Python logoPython
  • recipes
NoNoNov 15, 2026
GHSA-7gg4-cm2v-2p42MEDIUM6.5
  • Python logoPython
  • recipes
NoNoNov 15, 2026
GHSA-4crj-r7q3-qxhwMEDIUM5.4
  • Python logoPython
  • recipes
NoNoNov 15, 2026
GHSA-c34j-hcg4-386mMEDIUM4.3
  • Python logoPython
  • recipes
NoNoNov 15, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management