GHSA-h72h-ppcx-998p: Zebra network Zebra Has Pre-handshake Buffer Capacity Vulnerability
LOWGHSA-h72h-ppcx-998p is a LOW (CVSS 3.7) zebra has pre-handshake buffer capacity vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting Zebra network libraries in the crates.io ecosystem. The issue involves zebra has pre-handshake buffer capacity reservation based on attacker-claimed body length. Remediation is available by upgrading affected packages to version 7.0.0, 4.5.0.
GHSA-h72h-ppcx-998p at a Glance
Security Impact
CVSS: 3.7
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L).
How to Fix GHSA-h72h-ppcx-998p
To remediate this vulnerability, upgrade all affected Zebra network dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade zebra-network to 7.0.0
Upgrade zebrad to 4.5.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for zebra-network
How to Check if You Are Affected
To determine whether your application is affected by GHSA-h72h-ppcx-998p, inspect your project dependencies for Zebra network:
inspect dependencies for zebra-network
Analyze the terminal output to locate any version of Zebra network in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.0.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In Zebra network, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-h72h-ppcx-998p Affected Zebra network Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
zebra-network
|
crates.io |
< 7.0.0
|
7.0.0
|
|
zebrad
|
crates.io |
< 4.5.0
|
4.5.0
|
References
Frequently Asked Questions
What is GHSA-h72h-ppcx-998p?
Which Zebra network versions are affected?
What version fixes GHSA-h72h-ppcx-998p?
Is zebra-network affected?
Is zebrad affected?
What is the CVSS score of GHSA-h72h-ppcx-998p?
What CWE is associated with GHSA-h72h-ppcx-998p?
How can I check crates.io dependencies for GHSA-h72h-ppcx-998p?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-h72h-ppcx-998p",
"modified" : "2026-07-02T19:42:05Z",
"published" : "2026-07-02T19:42:05Z",
"aliases" : [ ],
"summary" : "Zebra has pre-handshake buffer capacity reservation based on attacker-claimed body length",
"details" : "### Am I affected\n\nYou are affected if:\n\n1. You run `zebrad` up to and including `v4.4.1`.\n2. Your node accepts inbound P2P connections (`network.listen_addr` is set, which is the default).\n\n### Summary\n\nThe 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.\n\nHowever, `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.\n\nZebra'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.\n\n### Details\n\nAt `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.\n\nNo 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.\n\n### Patches\n\nThe 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.\n\n### Workarounds\n\nNo workaround is needed. The existing per-IP rate limiting, handshake timeout, and connection limits effectively mitigate the practical impact.\n\n### Impact\n\nMinimal. 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.\n\n### Credit\n\nReported by `@ouicate` via a private GitHub Security Advisory submission.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "zebra-network"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "7.0.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 6.0.0"
}
}, {
"package" : {
"ecosystem" : "crates.io",
"name" : "zebrad"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.5.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 4.4.1"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/ZcashFoundation/zebra/security/advisories/GHSA-h72h-ppcx-998p"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/ZcashFoundation/zebra"
}, {
"type" : "WEB",
"url" : "https://github.com/ZcashFoundation/zebra/blob/d4cd662c716382f6397d2a730148025a1ca79fec/zebra-network/src/peer/handshake.rs#L917-L934"
}, {
"type" : "WEB",
"url" : "https://github.com/ZcashFoundation/zebra/blob/d4cd662c716382f6397d2a730148025a1ca79fec/zebra-network/src/protocol/external/codec.rs#L359-L416"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-770" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2026-07-02T19:42:05Z",
"nvd_published_at" : null
}
}