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

CVE-2026-110677: Cpanel::JSON::XS Memory Leak DOS Vulnerability

CVE-2026-110677 is a memory leak denial of service flaw in Cpanel::JSON::XS for Perl that exhausts process memory through duplicate key handling. This post explains its technical details, affected versions, and mitigation steps.

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-110677 Overview

CVE-2026-110677 is a memory leak vulnerability in Cpanel::JSON::XS, a widely used Perl module for JSON parsing. Affected versions range from 4.28 up to but not including 4.80. The flaw resides in the decode_hv function when the dupkeys_as_arrayref option is enabled. When a JSON object contains duplicate keys, the module collects the values into a new array but fails to release an extra reference. The array and its values outlive the decoded structure, and the leak also occurs when decoding fails after a duplicate key is encountered. Repeated decoding of untrusted JSON payloads with duplicate keys and large values can exhaust process memory [CWE-401].

Critical Impact

Attackers who can submit JSON input to a Perl application using dupkeys_as_arrayref can trigger unbounded memory growth leading to denial of service.

Affected Products

  • Cpanel::JSON::XS for Perl, versions 4.28 through 4.79
  • Perl applications invoking decode_json-style APIs with the dupkeys_as_arrayref option enabled
  • Downstream distributions and services bundling vulnerable Cpanel::JSON::XS releases

Discovery Timeline

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

Technical Details for CVE-2026-110677

Vulnerability Analysis

The vulnerability is a reference count error in the XS (C-level) implementation of Cpanel::JSON::XS. When dupkeys_as_arrayref is enabled, the decoder encountering a duplicate key in a JSON object creates a new Perl array (AV) to hold the collected values. The code wrapped that array in a reference using newRV, which increments the array's reference count. Because the local AV already carried a reference the caller intended to transfer into the new RV, the array ended up with one more reference than needed. The surplus reference prevented Perl's garbage collector from reclaiming the array and its contents when the enclosing hash was destroyed.

Root Cause

The root cause is incorrect use of the Perl API newRV instead of newRV_noinc when wrapping a freshly allocated AV. The leak also triggers on error paths where decoding fails after a duplicate key is processed, so partial parses accumulate orphaned arrays [CWE-401]. Each leaked array retains every duplicate value, including large strings or nested structures.

Attack Vector

An attacker supplies JSON documents containing duplicate object keys whose values are large or numerous. Each decode call leaves the collected array in memory. Repeated requests exhaust the Perl process's heap, causing service degradation or termination. Exploitation requires that the target application opt into dupkeys_as_arrayref; applications using default settings are not affected.

text
                           AV *av = newAV ();
                           av_extend (av, 2);
                           if (av_store (av, 0, old_value))
-                            old_value = newRV ((SV*)av);
+                            old_value = newRV_noinc ((SV*)av);
                           if (!dupkeys_seen)
                             {
                               dupkeys_seen = newHV ();

Source: GitHub Patch Commit

The one-line change swaps newRV for newRV_noinc, transferring ownership of the array into the reference without incrementing the refcount a second time.

Detection Methods for CVE-2026-110677

Indicators of Compromise

  • Sustained, unexplained growth of resident set size (RSS) in Perl processes that parse JSON input
  • Repeated inbound JSON payloads containing objects with duplicate keys and large values
  • Perl worker crashes or restarts triggered by out-of-memory conditions under JSON-heavy workloads

Detection Strategies

  • Audit application code and dependencies for use of the dupkeys_as_arrayref option in Cpanel::JSON::XS
  • Inventory installed Perl modules and flag any Cpanel::JSON::XS release prior to 4.80
  • Add web application firewall rules to inspect JSON bodies for duplicate keys when such input is not expected

Monitoring Recommendations

  • Track per-process memory metrics for Perl services with alerts on abnormal growth rates
  • Log and sample JSON payload characteristics (key counts, duplicate keys, body size) at ingress
  • Correlate OOM-killer events and worker restarts with incoming request patterns to spot abuse

How to Mitigate CVE-2026-110677

Immediate Actions Required

  • Upgrade Cpanel::JSON::XS to version 4.80 or later on all systems running Perl applications
  • Identify applications that enable dupkeys_as_arrayref and prioritize them for patching
  • Restart long-running Perl workers after upgrade so the patched module replaces the loaded version

Patch Information

The fix is included in Cpanel::JSON::XS version 4.80, released by maintainer RURBAN. The code change replaces newRV with newRV_noinc in decode_hv so the array holding duplicate values is reclaimed when the enclosing structure is freed. Review the GitHub Patch Commit and the MetaCPAN Release Changes for release details.

Workarounds

  • Disable dupkeys_as_arrayref if the application does not require preserving duplicate key values
  • Reject JSON inputs containing duplicate object keys at the application boundary before decoding
  • Enforce request size limits and per-process memory ceilings so leaks cannot exhaust host memory
bash
# Upgrade Cpanel::JSON::XS to the patched release
cpanm Cpanel::JSON::XS@4.80

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

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.