GHSA-h72h-ppcx-998p: Zebra has pre-handshake buffer capacity reservation based on attacker-claimed body length
Am I affected You are affected if: 1. You run zebrad up to and including v4.4.1. 2. Your node accepts inbound P2P connections (network.listenaddr is set, which is the default). Summary The P2P codec's Codec::decode() method calls src.reserve(bodylen + HEADERLEN) after parsing a 24-byte protocol header, using the attacker-claimed bodylen field.
Published Jul 2, 2026
Affected packages
zebra-network
- Ecosystem
- Rust (crates.io)
- Affected
- <= 6.0.0
- Fixed in
- 7.0.0
- Check
cargo tree -i zebra-network
zebrad
- Ecosystem
- Rust (crates.io)
- Affected
- <= 4.4.1
- Fixed in
- 4.5.0
- Check
cargo tree -i zebrad
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Am I affected
You are affected if:
- You run
zebradup to and includingv4.4.1. - Your node accepts inbound P2P connections (
network.listen_addris set, which is the default).
Summary
The P2P codec's Codec::decode() method calls src.reserve(body_len + HEADER_LEN) after parsing a 24-byte protocol header, using the attacker-claimed body_len field. This reserves up to MAX_PROTOCOL_MESSAGE_LEN (~2 MiB) of virtual buffer capacity per connection before any body bytes arrive and before the handshake completes.
However, BytesMut::reserve() sets virtual capacity without committing physical memory pages. The operating system does not allocate physical RAM until bytes are actually written into the buffer. Since the attacker never sends body bytes, the reserved capacity remains uncommitted. Reproduction of the reporter's PoC (256 threads, 30 seconds of sustained connections) showed negligible RSS impact on the Zebra process.
Zebra's existing mitigations further constrain the practical attack surface: per-IP connection limits (max_connections_per_ip = 1), a per-connection accept rate of approximately one per second, and a 3-second handshake timeout that cleans up idle connections.
Details
At zebra-network/src/protocol/external/codec.rs:406, after parsing the 24-byte header and validating the network magic and body length against MAX_PROTOCOL_MESSAGE_LEN, the codec calls src.reserve(body_len + HEADER_LEN). The codec is constructed on the bare TCP stream before negotiate_version() runs, so the reservation is reachable from any TCP peer that can send 24 bytes.
No legitimate Zcash handshake message (version, verack) is anywhere close to 2 MiB. The codec makes no distinction between pre-handshake and post-handshake message types when sizing the reservation.
Patches
The fix defers large buffer reservations until after the handshake completes, or caps the per-message reservation for pre-handshake messages to what version/verack actually require.
Workarounds
No workaround is needed. The existing per-IP rate limiting, handshake timeout, and connection limits effectively mitigate the practical impact.
Impact
Minimal. The reservation affects virtual address space only, not physical memory. Zebra's existing connection-management mitigations (per-IP limits, accept rate, handshake timeout) further constrain the attack. The code path is worth cleaning up for defense-in-depth but does not produce a measurable denial-of-service effect.
Credit
Reported by @ouicate via a private GitHub Security Advisory submission.
Credited to ouicate, oxarbitrage.
References
- https://github.com/ZcashFoundation/zebra/security/advisories/GHSA-h72h-ppcx-998p
- https://github.com/ZcashFoundation/zebra/blob/d4cd662c716382f6397d2a730148025a1ca79fec/zebra-network/src/peer/handshake.rs#L917-L934
- https://github.com/ZcashFoundation/zebra/blob/d4cd662c716382f6397d2a730148025a1ca79fec/zebra-network/src/protocol/external/codec.rs#L359-L416
- https://github.com/advisories/GHSA-h72h-ppcx-998p
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Rust (crates.io) vulnerabilities
All Rust (crates.io) entriesCVE-2026-54496
Zebra: Missing copy constraint in halo2_gadgets variable-base scalar multiplication allows under-constrained base, breaking Orchard Action circuit soundness
critical9.3Jul 6, 2026CVE-2026-52731
zebrad has full node denial of service via non-ASCII LongPollId in getblocktemplate
medium6.5Jul 2, 2026CVE-2026-52732
zebrad has mempool transaction admission denial via single-peer inbound queue saturation
medium5.3Jul 2, 2026CVE-2026-52733
zebrad has persistent on-disk corruption of Sapling/Orchard subtree roots after chain fork via pop_tip
medium6.5Jul 2, 2026CVE-2026-52734
zebrad has unbounded memory leak in mempool download pipeline via timeout path cancel_handles retention
medium5.3Jul 2, 2026CVE-2026-52735
zebrad has consensus divergence via P2SH sigop undercount in pure-Rust disabled-opcode parser
critical9.3Jul 2, 2026
