highCVSS 7.5Vulnerability

GHSA-mx64-mj3q-7prj

# Memory Exhaustion via Unbounded Map Allocations in Avro Decoder ## Summary The Avro map decoder accepted attacker-controlled block-element counts from the wire format and grew the destination map without enforcing an upper bound. The slice decoder already had `Config.MaxSliceAllocSize` for the equivalent attack against arrays; the map decoder had no analogous limit, so a producer could declare an arbitrarily large map (in one block, or chunked across many sub-limit blocks) and exhaust process memory until the OOM killer fired. The fix introduces `Config.MaxMapAllocSize` with cumulative enforcement across block boundaries. **The new limit is opt-in**: the field defaults to zero, which preserves the previous unbounded behavior for backward compatibility. **Upgrading to `v2.33.0` alone does not mitigate the issue** — consumers of untrusted Avro data must explicitly set `MaxMapAllocSize` on their `avro.Config`. ## Description Avro maps are encoded as a sequence of blocks; each block declares a `long` element count followed by that many key/value pairs. The decoder uses these counts both to size the destination map and as the loop bound for reading entries. Pre-fix, the map decoder enforced no upper limit at any layer: - No per-block element-count check. - No cumulative across-block element-count check. - No memory-budget check before `make(map[...]..., n)` or before growing the map. The slice decoder had been hardened via `Config.MaxSliceAllocSize` and tracked cumulatively across blocks; the map decoder was a missing-by-symmetry gap. Even a partial per-block bound on maps would have been insufficient on its own — Avro permits encoding a logical map as many small blocks, so a producer could split a 10 GB map into 10,000 sub-MaxMapAllocSize blocks and still drive total allocation past any single-block threshold. The fix tracks cumulative entry count at block-header boundaries — *before* the block's entries are decoded into the map — and errors out before allocat

Properties

ghsa_id
GHSA-mx64-mj3q-7prj
severity
high
summary
iskorotkov/avro: Denial-of-Service Vulnerability in Decoder
cvss_score
7.5
cve_id
GHSA-mx64-mj3q-7prj
cvss_vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
is_ghsa_only
true
ghsa_published
2026-05-18T12:59:58Z
source_url
https://github.com/advisories/GHSA-mx64-mj3q-7prj
ghsa_updated
2026-05-18T12:59:59Z

Related Entities (7)

VULNERABLE_TO (1)

[Software]go/github.com/iskorotkov/avro/v2

AFFECTS (1)

[Software]go/github.com/iskorotkov/avro/v2

HAS_WEAKNESS (4)

[Weakness]Improper Validation of Specified Quantity in Input
[Weakness]Memory Allocation with Excessive Size Value
[Weakness]Allocation of Resources Without Limits or Throttling
[Weakness]Uncontrolled Resource Consumption

REPORTED_BY (1)

[Source]GitHub Advisory Database

Explore deeper with Ninja Signal's threat intelligence graph

GHSA-mx64-mj3q-7prj (CVSS 7.5) — Ninja Signal Threat Intelligence | Ninja Signal