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

CVE-2026-110687: Cpanel::JSON::XS Information Disclosure

CVE-2026-110687 is an information disclosure flaw in Cpanel::JSON::XS for Perl affecting versions 4.43 to 4.79. The vulnerability causes inconsistent canonical encoding that can expose data. This article covers technical details, affected versions, impact, and mitigation strategies.

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

CVE-2026-110687 affects Cpanel::JSON::XS versions 4.43 through 4.79 for Perl. The flaw lies in the utf16_cmp function used during canonical encoding. When any key in a hash carries the UTF-8 flag, the comparator decodes every key as UTF-8, including byte-string keys that the encoder emits as Latin-1. Byte-string keys whose bytes happen to form valid UTF-8 are sorted out of order. Two keys that encode to different output can also compare equal and remain in native hash order. The result: identical input data serializes to different canonical JSON documents across processes [CWE-176].

Critical Impact

Canonical JSON output is non-deterministic, breaking any system that relies on byte-identical serialization for signatures, hashing, deduplication, or content-addressable storage.

Affected Products

  • Cpanel::JSON::XS for Perl, version 4.43
  • Cpanel::JSON::XS for Perl, versions 4.44 through 4.79
  • Downstream Perl applications depending on canonical JSON output for cryptographic or integrity purposes

Discovery Timeline

  • 2026-10-19 - CVE-2026-110687 published to the National Vulnerability Database (NVD)
  • 2026-10-19 - Last updated in NVD database

Technical Details for CVE-2026-110687

Vulnerability Analysis

The canonical option in Cpanel::JSON::XS is intended to produce deterministic JSON output by sorting hash keys. Sorting uses UTF-16 code-unit comparison through utf16_cmp. The comparator path assumes all keys share the same string representation. When at least one key in the hash is UTF-8 flagged, the function treats every key as UTF-8 encoded, even those stored as raw byte strings.

A byte-string key whose bytes form a valid UTF-8 sequence is reinterpreted into a different code-point sequence for sorting. This positions it incorrectly relative to its true emitted Latin-1 representation. Worse, two distinct keys can compare equal under the mismatched decoding and skip the sort step, falling back to Perl hash insertion order.

Root Cause

The root cause is an encoding mismatch between comparison and emission (CWE-176). The encoder writes byte-string keys as Latin-1 characters, but the sort comparator decodes those same bytes as UTF-8 whenever any sibling key carries the UTF-8 flag. The two code paths disagree about what the key "is," producing an ordering that does not match the serialized output.

Attack Vector

The vulnerability does not directly yield code execution. It undermines integrity guarantees built on canonical JSON, such as RFC 8785 JSON Canonicalization Scheme signatures, JWS payloads, content hashes, blockchain transaction encoding, and cache keys. An attacker who can influence hash contents may craft inputs that produce divergent canonical outputs across processes or hosts, defeating signature verification or causing hash collisions in deduplication systems.

text
           a_unit = pending_a;
           pending_a = 0;
         }
+      else if (alen && !SvUTF8 (a_sv))
+        {
+          a_unit = *ap++; /* byte string: each byte is one Latin-1 character */
+          alen--;
+        }
       else if (alen)
         {
           {

Source: GitHub Commit bb9da30. The patch adds a dedicated branch in utf16_cmp so byte-string operands are read one byte at a time as Latin-1 characters, matching how the encoder serializes them.

Detection Methods for CVE-2026-110687

Indicators of Compromise

  • Divergent canonical JSON output for the same logical hash across two Perl processes or hosts
  • Signature verification failures on JSON documents that previously verified successfully
  • Unexpected cache misses or duplicate entries in content-addressable stores keyed on canonical JSON hashes

Detection Strategies

  • Inventory installed CPAN modules and flag any Cpanel::JSON::XS version in the range 4.43 to 4.79 inclusive.
  • Add a regression test that encodes a hash containing both UTF-8 flagged and byte-string keys with canonical => 1 and compares output against a known-good fixture.
  • Audit code paths that call encode_json or ->canonical(1) and feed the result into hashing, signing, or deduplication logic.

Monitoring Recommendations

  • Log and alert on JSON signature verification failures across services exchanging canonical JSON.
  • Monitor CPAN dependency manifests (cpanfile, Makefile.PL, META.json) in CI for the vulnerable version range.
  • Track outputs of batch jobs that produce canonicalized JSON to detect non-deterministic serialization between runs.

How to Mitigate CVE-2026-110687

Immediate Actions Required

  • Upgrade Cpanel::JSON::XS to version 4.80 or later on all Perl systems.
  • Re-run signature and integrity checks on JSON artifacts produced by vulnerable versions and re-sign where needed.
  • Review and normalize hash key types before canonical encoding in security-sensitive code paths.

Patch Information

The fix is included in Cpanel::JSON::XS4.80. See the MetaCPAN Release Changes and the upstream commit bb9da30b67f637f4d57922f0e043376363f28f0c. The patch extends t/10_pc_keysort.t with an additional test asserting correct byte-string key ordering.

Workarounds

  • Explicitly decode or encode all hash keys to a single, consistent representation (all UTF-8 flagged or all byte strings) before invoking canonical encoding.
  • Avoid mixing UTF-8 flagged and byte-string keys in the same hash when canonical => 1 is used for signing or hashing.
  • Pin dependencies to Cpanel::JSON::XS>= 4.80 in cpanfile to prevent reintroduction of the vulnerable range.
bash
# Upgrade via cpanm
cpanm Cpanel::JSON::XS@4.80

# Pin minimum version in cpanfile
echo "requires 'Cpanel::JSON::XS', '>= 4.80';" >> cpanfile

# 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

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.