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-110681 Overview
CVE-2026-110681 is a use-after-free vulnerability [CWE-416] in Cpanel::JSON::XS versions before 4.80 for Perl. The parser object stores its callbacks and incremental parse buffer as raw scalar (SV) pointers. When a Perl interpreter thread (ithread) is created, these pointers are copied byte-for-byte into the child interpreter without duplication. The child thread then operates on, and ultimately frees, scalars that belong to the parent interpreter.
A parser instance created before an ithread starts and used inside that thread can invoke freed callbacks, corrupt reference counts, and crash the hosting process.
Critical Impact
Threaded Perl applications using Cpanel::JSON::XS parser objects across ithread boundaries risk process crashes and memory corruption through freed SV access.
Affected Products
- Cpanel::JSON::XS for Perl, all versions before 4.80
- Threaded Perl 5.8.9 and newer builds compiled with useithreads
- Applications and modules that instantiate a parser before spawning threads->create
Discovery Timeline
- 2026-10-19 - CVE-2026-110681 published to the National Vulnerability Database
- 2026-10-19 - Last updated in NVD database
Technical Details for CVE-2026-110681
Vulnerability Analysis
The JSON C struct used by Cpanel::JSON::XS holds four scalar pointers: cb_object, cb_sk_object, cb_sort_by, and incr_text. The first three store user-supplied filter and sort callbacks registered through filter_json_object, filter_json_single_key_object, and sort_by. The fourth holds the incremental parser's working buffer.
Perl's ithread model does not share SVs between interpreters. Each thread owns its own interpreter and must duplicate SVs via sv_dup during the clone phase. Before version 4.80, Cpanel::JSON::XS did not register a CLONE magic hook, so when threads->create cloned a parser object, the child interpreter received raw pointers into the parent's arena.
Any subsequent decode, incr_parse, or callback invocation inside the child thread dereferenced those parent-owned SVs. When either interpreter freed the scalars, the other operated on dangling memory, producing use-after-free conditions, reference count corruption, and process crashes.
Root Cause
The parser object's magic vtable did not implement a svt_dup handler. Perl therefore copied the PV (the serialized JSON struct) byte-for-byte without walking the embedded SV pointers to produce thread-local duplicates.
Attack Vector
Exploitation requires local code reaching a parser instance that is shared across an ithread boundary. The condition is reachable in any Perl program that constructs a Cpanel::JSON::XS object with filter callbacks and then spawns worker threads that reuse the object.
// Patch excerpt: register a CLONE magic duplication handler
#if defined(USE_ITHREADS) && (PERL_VERSION > 8 || (PERL_VERSION == 8 && PERL_SUBVERSION >= 9))
#define JSON_MG_DUP
#ifndef sv_dup_inc
#define sv_dup_inc(s,t) SvREFCNT_inc (sv_dup (s,t))
#endif
/* the object's PV is copied byte for byte into a new thread: give the copy its own SVs */
static int
json_mg_dup (pTHX_ MAGIC *mg, CLONE_PARAMS *param)
{
JSON *json = (JSON *)SvPVX (mg->mg_obj);
if (SvLEN (mg->mg_obj) < sizeof (JSON))
return 0;
json->cb_object = sv_dup_inc (json->cb_object, param);
json->cb_sk_object = (HV *)sv_dup_inc ((SV *)json->cb_sk_object, param);
json->cb_sort_by = sv_dup_inc (json->cb_sort_by, param);
json->incr_text = sv_dup_inc (json->incr_text, param);
return 0;
}
static MGVTBL json_mg_vtbl = { 0, 0, 0, 0, 0, 0, json_mg_dup, 0 };
#endif
Source: GitHub Patch Submission
The fix adds a json_mg_dup function wired into the parser's MGVTBL. During thread cloning, Perl now calls the handler to duplicate each callback and buffer SV with its own reference count in the child interpreter.
Detection Methods for CVE-2026-110681
Indicators of Compromise
- Unexpected segmentation faults or panic: free from wrong pool messages in Perl worker processes that use Cpanel::JSON::XS
- SvREFCNT assertion failures or Attempt to free unreferenced scalar warnings emitted from threaded workers
- Core dumps whose stack traces include decode_json, incr_parse, or filter callback frames inside a non-main ithread
Detection Strategies
- Inventory installed CPAN modules and flag any Cpanel::JSON::XS release below 4.80 using cpanm --info or perl -MCpanel::JSON::XS -e 'print $Cpanel::JSON::XS::VERSION'
- Audit source for parser objects created outside a threads->create block that are then captured by thread subroutines
- Review long-running Perl services (mod_perl, Starman, Hypnotoad) for crash-restart loops correlated with JSON decoding workloads
Monitoring Recommendations
- Collect and centralize Perl process crash telemetry, including signal 11 exits and abort() traces
- Alert on reference count corruption messages from Perl's -DDEBUGGING builds in staging environments
- Track CPAN module versions as part of the software bill of materials for Perl-based services
How to Mitigate CVE-2026-110681
Immediate Actions Required
- Upgrade Cpanel::JSON::XS to version 4.80 or later across all Perl installations
- Rebuild any vendored or system packages that bundle an older copy of the module
- Restart long-running Perl services after upgrade so new interpreter processes load the patched XS code
Patch Information
The fix landed in commit c53eefb and ships in Cpanel::JSON::XS 4.80. Review the MetaCPAN Release Changes and the GitHub Patch Submission for the full source diff and regression test in t/128_threads_clone.t.
Workarounds
- Construct a new Cpanel::JSON::XS object inside each ithread rather than cloning a parent instance
- Avoid registering filter_json_object, filter_json_single_key_object, or sort_by callbacks on parsers that will cross a thread boundary
- Where upgrading is not immediately possible, serialize JSON work onto a single interpreter and marshal only decoded data between threads
# Verify the installed module version and upgrade via cpanm
perl -MCpanel::JSON::XS -e 'print "$Cpanel::JSON::XS::VERSION\n"'
cpanm Cpanel::JSON::XS@4.80
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

