UBUNTU-CVE-2026-129113: Medium severity ubuntu/libjson-xs-perl vulnerability
JSON::XS versions from 4.000 before 4.05 for Perl corrupt the incremental buffer length by chopping past its end in incrskip after a top-level number. The incremental parser scans any run of digits, signs, dots and exponent markers as one number, but the decoder stops at the end of a valid number, so the parser keeps an offset into bytes it has not decoded. It then empties the buffer without clearing those bytes, and a later incrparse call without new input reads them again and moves the offset past the end of the buffer. incrskip, the documented recovery after an error, removes that many bytes and the buffer length wraps. A peer sending input such as "1-2" to an incrparse consumer can make the next read of incrtext exit the process through perl's uncatchable out-of-memory path.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 4.05
Event History
Frequently Asked Questions
Which applications are exposed to this issue?
Applications using JSON::XS incremental parsing on data received from a peer are exposed if they can process malformed top-level numeric input. The affected code path involves incr_parse and the documented incr_skip recovery method.
What input and call sequence can trigger the failure?
A peer can send input such as "1-2" to an incr_parse consumer. After the parser retains an offset beyond the decoded buffer, a later incremental parse call without new input can reuse stale bytes; calling incr_skip then removes an invalid byte count and can wrap the buffer length.
What is the practical impact?
The next read of incr_text can cause the Perl process to exit through an uncatchable out-of-memory path. This is a denial-of-service condition for affected consumers.
How can I determine whether a deployment needs remediation?
Check whether it uses JSON::XS versions from 4.0_00 before 4.05 and whether it uses the incremental parsing API with incr_parse, incr_text, or incr_skip. The affected Ubuntu software package is libjson-xs-perl.
What can be done if an update cannot be applied immediately?
Avoid processing untrusted peer input through the affected incremental parsing and recovery flow, particularly malformed top-level number-like strings such as "1-2". Ensure application paths do not call incr_skip after this parser state is reached.