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-110684 Overview
CVE-2026-110684 affects Cpanel::JSON::XS versions from 3.0202 before 4.80, a widely used Perl module for JSON encoding and decoding. The flaw resides in the encode_stringify function, which fails to release temporary references when encoding overloaded objects as strings. Encoding blessed array, hash, or scalar objects with a "" overload leaks memory because the module takes an extra reference that is never released. The referenced object graph and, from version 4.10, the stringified copy are never freed. Long-running Perl processes that repeatedly encode such values grow in memory without bound, enabling resource exhaustion [CWE-401].
Critical Impact
Repeated encoding of overloaded blessed objects causes unbounded process memory growth, leading to denial of service on long-running Perl applications and web services.
Affected Products
- Cpanel::JSON::XS for Perl, versions 3.0202 through 4.79
- Perl applications using allow_stringify, convert_blessed (for objects without TO_JSON), or allow_bignum
- Downstream distributions and web stacks bundling vulnerable Cpanel::JSON::XS releases
Discovery Timeline
- 2026-10-19 - CVE-2026-110684 published to the National Vulnerability Database
- 2026-10-19 - Last updated in NVD database
Technical Details for CVE-2026-110684
Vulnerability Analysis
The defect is a memory leak in the encode_stringify routine of Cpanel::JSON::XS. The function writes a value in its string form when allow_stringify is set, when convert_blessed is used on objects lacking a TO_JSON method, or when allow_bignum is enabled. For array or hash blessed objects implementing the "" overload, and from version 4.20 for scalar blessed objects, the encoder constructs a new reference via newRV without decrementing the refcount. The reference, the blessed object, and every value it transitively references remain pinned in memory. From version 4.10, the stringified SV copy itself also never reaches SvREFCNT_dec.
Root Cause
The root cause is a missing reference release in the XS code path that handles overloaded stringification. The call sv_copypv(pv, newRV(sv)) creates a reference without mortalizing it, so Perl's reference-counted garbage collector never reclaims the storage. The patched code wraps the new reference with sv_2mortal(newRV_inc(sv)), ensuring the temporary reference is freed at the end of the current pseudo-block.
Attack Vector
An attacker exploits the flaw by submitting JSON-encoding workloads that contain blessed objects with string overloading. Any Perl service that accepts user-controlled structured data and encodes it with convert_blessed, allow_stringify, or allow_bignum is exposed. Repeated requests drive the process heap upward until the operating system kills the worker or the host exhausts memory.
#if PERL_VERSION > 7
pv = newSVpvs("");
if (!isref && !(enc->json.flags & F_ALLOW_STRINGIFY)) {
- sv_copypv(pv, newRV(sv));
+ sv_copypv(pv, sv_2mortal (newRV_inc (sv)));
} else {
sv_copypv(pv, sv);
}
Source: GitHub commit 5b15916
The regression test added alongside the fix demonstrates the leak by counting DESTROY invocations on overloaded objects:
use strict;
use Test::More tests => 2;
use Cpanel::JSON::XS;
my $freed = 0;
package Str;
use overload '""' => sub { 'str' }, fallback => 1;
sub DESTROY { $freed++ }
package main;
Cpanel::JSON::XS->new->convert_blessed->encode([ bless {}, 'Str' ]);
is( $freed, 1, 'hash object' );
{ my $s = 'x'; Cpanel::JSON::XS->new->convert_blessed->encode([ bless \$s, 'Str' ]) }
is( $freed, 2, 'scalar object' );
Source: GitHub commit 5b15916 - t/129_stringify_leak.t
Detection Methods for CVE-2026-110684
Indicators of Compromise
- Steady, monotonic growth of resident set size (RSS) in Perl worker processes handling JSON encoding
- Out-of-memory kills (oom-killer) targeting Perl fcgi, plackup, starman, or mod_perl workers
- Elevated page faults and swap usage correlated with endpoints that serialize blessed objects
Detection Strategies
- Audit code for calls to ->convert_blessed, ->allow_stringify, or ->allow_bignum on Cpanel::JSON::XS encoders and verify the installed module version is >= 4.80.
- Enable Perl heap profiling with Devel::MAT or Devel::Gladiator to detect retained SV references after encode operations.
- Add runtime memory watchdogs to worker supervisors to alert when a process exceeds a baseline RSS threshold during JSON-heavy workloads.
Monitoring Recommendations
- Track per-process RSS and virtual memory metrics for Perl services in Prometheus, Datadog, or equivalent telemetry pipelines.
- Alert on repeated worker restarts emitted by process managers such as systemd, supervisord, or Server::Starter.
- Forward dmesg and kernel logs containing Out of memory entries to a centralized data lake for correlation with application activity.
How to Mitigate CVE-2026-110684
Immediate Actions Required
- Upgrade Cpanel::JSON::XS to version 4.80 or later from CPAN on all Perl hosts.
- Inventory applications that call convert_blessed, allow_stringify, or allow_bignum and prioritize those exposed to untrusted input.
- Restart long-running Perl workers after upgrading to release accumulated leaked memory.
Patch Information
The fix is included in Cpanel::JSON::XS release 4.80. The upstream commit 5b15916b5e7841e447664ace51fb50c12d1e0f39 wraps the temporary reference in sv_2mortal(newRV_inc(sv)) so Perl's garbage collector reclaims it. See the MetaCPAN release changes and the GitHub commit patch for details.
Workarounds
- Define an explicit TO_JSON method on blessed classes so convert_blessed bypasses the vulnerable stringification path.
- Disable allow_stringify and allow_bignum on JSON encoders that process attacker-controlled data.
- Configure process supervisors to recycle Perl workers after a bounded number of requests to cap memory accumulation until patching completes.
# Upgrade Cpanel::JSON::XS to the patched release
cpanm Cpanel::JSON::XS@4.80
# Verify installed version
perl -MCpanel::JSON::XS -E 'say $Cpanel::JSON::XS::VERSION'
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

