Skip to main content
Vulnerability Database/CVE-2026-110678

CVE-2026-110678: Cpanel::JSON::XS DoS Vulnerability

CVE-2026-110678 is a denial of service vulnerability in Cpanel::JSON::XS for Perl that allows memory exhaustion through incremental parsing. This post covers the technical details, affected versions, impact, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-110678 Overview

CPAN module Cpanel::JSON::XS before version 4.80 contains a memory exhaustion flaw in its incremental parser. The incr_parse function appends every received chunk to an internal buffer but compares max_size against parser progress rather than buffer length. A peer can send a chunk starting with a NUL byte to halt parser progress while continuing to grow the buffer. Calls in void context skip the size check entirely. A remote peer streaming data to any incr_parse consumer can exhaust process memory regardless of the configured max_size limit. The weakness is classified as Allocation of Resources Without Limits or Throttling [CWE-770].

Critical Impact

Remote peers streaming to an incr_parse consumer can exhaust process memory and trigger denial of service, bypassing the max_size safeguard.

Affected Products

  • Cpanel::JSON::XS Perl module versions before 4.80
  • Perl applications using incr_parse with streaming input
  • Services that expose incr_parse consumers to untrusted network peers

Discovery Timeline

  • 2026-10-19 - CVE CVE-2026-110678 published to NVD
  • 2026-10-19 - Last updated in NVD database

Technical Details for CVE-2026-110678

Vulnerability Analysis

The incremental parser in Cpanel::JSON::XS is designed to accept JSON data in chunks. The max_size option exists to cap the amount of buffered input and defend against unbounded resource consumption. The implementation enforces this cap incorrectly.

When incr_parse is called in scalar or list context, the module measures how far the parser has advanced through the input rather than how many bytes have been appended to incr_text. Any condition that halts forward progress leaves the growing buffer unchecked. When incr_parse is called in void context, the size check is skipped altogether.

The practical impact is memory exhaustion against any Perl process consuming untrusted streaming JSON. The weakness falls under uncontrolled resource consumption [CWE-770].

Root Cause

The root cause is a mismatch between what max_size is intended to bound (buffered bytes held by the parser) and what the pre-patch code actually compares against it (parser progress position). An attacker-controlled leading NUL byte prevents the parser from advancing, so incr_pos stays near zero while SvCUR(incr_text) grows without bound.

Attack Vector

An attacker that can stream bytes to a service using Cpanel::JSON::XS::incr_parse sends a payload starting with a NUL byte, then continues to transmit arbitrary data. The parser stalls, the buffer grows, and the process consumes memory until it is killed by the operating system or the host becomes unresponsive.

text
};

#define INCR_DONE(json) ((json)->incr_nest <= 0 && (json)->incr_mode == INCR_M_JSON)
+/* the first text once complete, else everything buffered */
+#define INCR_SIZE(json) (INCR_DONE (json) ? (json)->incr_pos : SvCUR ((json)->incr_text))

typedef struct {
  U32 flags;

Source: GitHub patch commit d516f29

The patch introduces INCR_SIZE, which returns the actual buffered length (SvCUR(incr_text)) while parsing is in progress, so max_size is enforced against buffered bytes rather than parser position.

Detection Methods for CVE-2026-110678

Indicators of Compromise

  • Perl processes using Cpanel::JSON::XS showing sustained RSS growth without corresponding output or progress
  • Inbound streaming JSON sessions where the first byte received is 0x00 followed by non-terminating data
  • Repeated OOM-kill events targeting Perl workers that parse streaming JSON input

Detection Strategies

  • Inventory installed CPAN modules on Perl hosts and flag Cpanel::JSON::XS versions below 4.80
  • Inspect application code for calls to incr_parse, especially in void context, on network-facing endpoints
  • Instrument services to log buffer sizes exceeding configured max_size and alert on anomalies

Monitoring Recommendations

  • Track per-process memory for Perl daemons that handle JSON streams and alert on sustained growth
  • Monitor network inputs to JSON-consuming services for payloads containing a leading NUL byte
  • Correlate OOM-killer events with inbound streaming sessions in centralized logging

How to Mitigate CVE-2026-110678

Immediate Actions Required

  • Upgrade Cpanel::JSON::XS to version 4.80 or later on all Perl hosts
  • Audit application code for uses of incr_parse, especially in void context, and refactor to a context where the size check applies
  • Apply ingress rate limits and maximum request body sizes in front of services consuming streaming JSON

Patch Information

The fix is contained in commit d516f29 and shipped in Cpanel-JSON-XS 4.80. The patch adds an INCR_SIZE macro that returns SvCUR(incr_text) while incremental parsing is in progress, ensuring max_size is enforced against the actual buffered byte count. Refer to the GitHub patch commit and the MetaCPAN 4.80 release changes.

Workarounds

  • Terminate TLS or reverse-proxy JSON streams through a component that enforces a hard body-size cap independent of the Perl parser
  • Reject input streams whose first byte is 0x00 before passing data to incr_parse
  • Constrain Perl worker memory with ulimit -v or systemd MemoryMax= to contain runaway allocations until patching
bash
# Upgrade Cpanel::JSON::XS to the patched release
cpanm Cpanel::JSON::XS@4.80

# Verify the installed version
perl -MCpanel::JSON::XS -e 'print $Cpanel::JSON::XS::VERSION, "\n"'

# Constrain Perl worker memory as a stopgap (example: 512 MB)
systemctl set-property my-perl-service.service MemoryMax=512M

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.