Incremental parser can exceed max_size
Before 4.05, a NUL byte can cause incr_parse to accumulate incremental input beyond the configured size limit.
CPANSec disclosed seven JSON::XS vulnerabilities fixed in 4.05. Malformed JSON can exhaust memory or the stack, and specific incremental parsing and tagged serialization paths can mishandle memory. Update services that parse or encode untrusted data.
The input paths differ by flaw. Several affect the incremental decoder, and others affect invalid object or string parsing. The stack exhaustion and released-memory read depend on tagged mode. The latter is an encoding issue involving a FREEZE result. Services parsing untrusted JSON are the main priority, along with apps using tagged serialization.
CPANSec identifies memory exhaustion, hangs, crashes and invalid memory accesses as concerns. Its report does not establish exploitation in production. Request limits and disabling optional features reduce exposure while you prepare the upgrade.
Before 4.05, a NUL byte can cause incr_parse to accumulate incremental input beyond the configured size limit.
Before 4.05, rejecting an object with a missing colon can leave the allocation for a decoded key unreleased.
Before 4.05, decoding deeply nested tagged values with allow_tags enabled can exhaust the stack.
Before 4.05, rejection of a malformed long string can leave memory allocated for the already-decoded portion.
From 4.0_00 to before 4.05, after a malformed top-level number, incr_skip can use a stale offset beyond the end of the buffer and underflow its length.
From 3.04 to before 4.05, appending a one-byte chunk during incremental parsing can write one byte beyond the heap buffer.
From 3.0 to before 4.05, under allow_tags, serializing a FREEZE method result that grows the Perl stack can read released stack memory.
| Product | Safe from | Note |
|---|---|---|
| JSON::XS | 4.05 | First upstream release fixing the seven issues |
Nov 13, 2026
JSON-XS 4.05 is released
The distribution changelog describes the parser and serialization fixes.
Nov 14, 12:05 UTC
CPANSec publishes seven vulnerability advisories
The oss-security post gives affected ranges, trigger conditions and remediation.
We list each claim and who made it. Primary sources (the vendor, the researcher, the registry) are marked. Where reports disagree, we grade by the worst credible case.