JSON::XS before 4.05 has seven CVEs, including memory exhaustion
Named issues include a decoded-key leak, stack exhaustion, and incremental-parse memory exhaustion.
Memory exhaustion in JSON::XS incr_parse before 4.05
JSON::XS before 4.05 mishandles incremental parsing in incr_parse. A NUL byte within the first max_size bytes is treated as the end of input, so the buffer grows without the size check firing, and incr_skip cannot drop the NUL. A peer streaming chunks to an incr_parse consumer can exhaust process memory regardless of max_size. Perl applications that parse untrusted incremental JSON with this module are affected.
What to do: Upgrade JSON::XS to 4.05.
| Product | Affected | Fixed in |
|---|---|---|
| JSON-XS JSON::XS | before 4.05 | 4.05 |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
JSON::XS versions before 4.05 for Perl allow memory exhaustion by buffering incremental input past max_size after a NUL byte in incr_parse. The parser appends each chunk to its buffer and compares max_size with how far it has progressed, not with the buffer length. It treats a NUL byte as the end of the input, so a NUL within the first max_size bytes keeps it short of the limit. The buffer keeps growing, and incr_skip cannot remove the NUL. A peer streaming data to an incr_parse consumer can exhaust process memory regardless of max_size.
Named issues include a decoded-key leak, stack exhaustion, and incremental-parse memory exhaustion.
Today 106 readers · 106 views · 22 reads · all time 199K views