From patchwork Tue Dec 1 17:11:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ann Leelu George X-Patchwork-Id: 106850 Received: from mx0b-0064b401.pphosted.com (mx0b-0064b401.pphosted.com [205.220.178.238]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.16249.1796145526642279278 for ; Tue, 01 Dec 2026 09:18:46 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=DyypAlnt; spf=none, err=permanent DNS error (domain: oak-lpgbuild12.wrs.com, ip: 205.220.178.238, mailfrom: prvs=6795962cc8=ageorge1@oak-lpgbuild12.wrs.com) Received: from pps.filterd (m0250812.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B1F7QEn2314714 for ; Tue, 1 Dec 2026 17:11:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :message-id:mime-version:subject:to; s=PPS06212021; bh=Ap63M6dE3 5TOlXzLqMjSZVzGUlp5b078lj6N5X1kG60=; b=DyypAlntdRBqckQdZlq+5C3J0 Urxnv3vGBBo+B2bVRagQf+Ug0Npq+QeICwQ3BFCTwQrqjUp6jXUaZVXiHomRexmh /4Kmsad5nyfOCJSThwPqUhYLQN+GvPNK4trAPk2LT6kv0GCL7rwB46smTQ4+ce2A 7HmwOpNa5qLW4ztlGIiyLQ4ytVB0taW/cqPECfRGasEvRUjhb9F4dCaqDMLgu3e4 8K7ilMSGtqsGe2ESBepJAawmXEtylXiYsWkxe4SbGikHVN24JMK95jGvfGERKtSP 5ttLu0HdIoT8PgBRWRCmG0SrfjvFzIhgApXQoFgjXFpbmooc8CarSn+sWG6dA== Received: from ala-exchng02.corp.ad.wrs.com (ala-exchng02.wrs.com [128.224.246.37]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4j7nx753y4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 01 Dec 2026 17:11:58 +0000 (GMT) Received: from ala-p2exch02.corp.ad.wrs.com (10.11.226.102) by ALA-EXCHNG02.corp.ad.wrs.com (10.11.224.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.61; Tue, 1 Dec 2026 09:11:56 -0800 Received: from ALA-EXCHNG02.corp.ad.wrs.com (10.11.224.122) by ala-p2exch02.corp.ad.wrs.com (10.11.226.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.46; Tue, 1 Dec 2026 09:11:56 -0800 Received: from oak-lpgbuild12.wrs.com (10.11.232.110) by ALA-EXCHNG02.corp.ad.wrs.com (10.11.224.122) with Microsoft SMTP Server id 15.1.2507.61 via Frontend Transport; Tue, 1 Dec 2026 09:11:56 -0800 Received: by oak-lpgbuild12.wrs.com (Postfix, from userid 1762445393) id 808D639002CE; Tue, 1 Dec 2026 17:11:56 +0000 (UTC) From: Ann Leelu George To: CC: Ann Leelu George Subject: [meta-oe][PATCH] cjson: fix CVE-2026-67216 Date: Tue, 1 Dec 2026 17:11:53 +0000 Message-ID: <20261201171153.2060050-1-annleelu.george@windriver.com> X-Mailer: git-send-email 2.54.0 MIME-Version: 1.0 X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAxMDA2OCBTYWx0ZWRfX1kaOZx81uS/s C34pfhwNwBsxfYTVSJ6UnIK4wke+xh7MfmD0ppBr4GJXWA0q/pbXVTGTGS8HYSQZU5FqzVLPLnx uiIZRPzPyTOlndEwf1oCNMC/kWZ19tsJCSWRpUE858QS3RLJOZKW X-Proofpoint-ORIG-GUID: TN9zFAYt0-xKOEl9WnOPKAqsItnFnHI0 X-Authority-Analysis: v=2.4 cv=MKT1C8Zl c=1 sm=1 tr=0 ts=6b0effde cx=c_pps a=Lg6ja3A245NiLSnFpY5YKQ==:117 a=Lg6ja3A245NiLSnFpY5YKQ==:17 a=pUM-KoujPXoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=bi6dqmuHe4P4UrxVR6um:22 a=fTW__CHxibyLmBMfj2wP:22 a=NEAV23lmAAAA:8 a=t7CeM3EgAAAA:8 a=5jnOWLQ0fvMPLLjnlz0A:9 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-GUID: TN9zFAYt0-xKOEl9WnOPKAqsItnFnHI0 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAxMDA2OCBTYWx0ZWRfX7LnmgmvCDqHX jDgEB8p02d3+CInHq8c5yMgemuWRIHeqTlSpWrbdlmBm9zNi/jPWptnm68tM2/TOQu1iv/69zPG cnb8aZ8WUpYjCCDTUCb17uLlwze2j/uRvey4ZtPxuSgKs1HVMMtIjXbUODiIP/44I5vYv8jgt3B /8/QUIWHjo/WTAXOeE2F4breXWEvWqk+oS9MfZyz7Yz0P89R8LwU8tHS04l0G9i2jEmXu5BUO2a USZx5+zTwNvBS8g7R0r/hONJx6yJ4yj+WIa/v12Ev8Vi1aeDG8tJ1d6yfqfyG9U25SxCDeS36KT JitaF8b9etj/CSvfO/7sWZwHsb8dzaa3UXjz2xwtua/9krRqb9yYODYHduqA8sLA47dfZplrrpB L6CcXQCSmw3ZVag0lSlC1hur7N4n24JljPP/0CDwUbTlqhLtRnzsQRaiDAzkfF7hWpAWBTvdWAf j2yg0GcVDTKJk/rwgvA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-01_03,2026-12-01_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 priorityscore=1501 malwarescore=0 bulkscore=0 suspectscore=0 spamscore=0 phishscore=0 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612010068 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Tue, 01 Dec 2026 17:19:34 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/133753 cJSON_Compare() compares object members twice, once in each direction, recursing fully in both passes, so comparing structurally equal nested objects takes time exponential in the nesting depth. A few-hundred-byte document nested ~40 levels deep can consume hours of CPU (denial of service). Backport the fix submitted upstream, which replaces the redundant reverse-direction recursive compare with a presence check so each shared subtree is compared once. CVE: CVE-2026-67216 Signed-off-by: Ann Leelu George --- .../cjson/cjson/CVE-2026-67216.patch | 67 +++++++++++++++++++ .../recipes-devtools/cjson/cjson_1.7.19.bb | 1 + 2 files changed, 68 insertions(+) create mode 100644 meta-oe/recipes-devtools/cjson/cjson/CVE-2026-67216.patch diff --git a/meta-oe/recipes-devtools/cjson/cjson/CVE-2026-67216.patch b/meta-oe/recipes-devtools/cjson/cjson/CVE-2026-67216.patch new file mode 100644 index 0000000000..8409138ffd --- /dev/null +++ b/meta-oe/recipes-devtools/cjson/cjson/CVE-2026-67216.patch @@ -0,0 +1,67 @@ +From 3bbcec9dee9219f1281a6e4dd28e5df3ea779c01 Mon Sep 17 00:00:00 2001 +From: Ann Leelu George +Date: Tue, 6 Oct 2026 15:56:42 +0000 +Subject: [PATCH] Compare: avoid exponential recursion in cJSON_Compare + (CVE-2026-67216) + +cJSON_Compare() compared object subtrees twice, once in each direction, +recursing fully in both passes. The second pass existed only to reject the +case where a is a subset of b, but it re-ran cJSON_Compare() on every shared +child. For structurally equal, deeply nested objects this doubles the work at +every level, so the running time is exponential in the nesting depth: a small +(few-hundred-byte) document nested ~40 levels can consume hours of CPU. An +application that calls cJSON_Compare() on attacker-influenced JSON that is +structurally equal to a reference document is exposed to a denial of service. + +The forward pass already deep-compares every key of a against its counterpart +in b. The reverse pass therefore only needs to confirm that b has no keys +absent from a - a presence check, not a recursive comparison. Replace the +second cJSON_Compare() call with a get_object_item() lookup so each shared +subtree is compared exactly once. This removes the per-level doubling and +makes the runtime linear in the tree size (the pre-existing O(n^2) key lookup +is unchanged). Semantics are preserved for objects without duplicate keys: +unequal values are still caught by the forward pass, and extra keys in b +are still rejected. With duplicate keys, cJSON_Compare already matches +only the first occurrence on lookup, so results there were not well +defined before this change either. + +CVE: CVE-2026-67216 +Upstream-Status: Submitted [https://github.com/DaveGamble/cJSON/pull/1146] +Signed-off-by: Ann Leelu George +--- + cJSON.c | 12 +++++------- + 1 file changed, 5 insertions(+), 7 deletions(-) + +diff --git a/cJSON.c b/cJSON.c +index 88c2d95..09ba85e 100644 +--- a/cJSON.c ++++ b/cJSON.c +@@ -3170,8 +3170,11 @@ CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * cons + } + } + +- /* doing this twice, once on a and b to prevent true comparison if a subset of b +- * TODO: Do this the proper way, this is just a fix for now */ ++ /* Check that b has no keys absent from a. a's keys were already ++ * deep-compared against b above, so here a presence check is ++ * enough. Recursively comparing again in this direction would ++ * compare every shared subtree twice per level, making the ++ * runtime exponential in the nesting depth (CVE-2026-67216). */ + cJSON_ArrayForEach(b_element, b) + { + a_element = get_object_item(a, b_element->string, case_sensitive); +@@ -3179,11 +3182,6 @@ CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * cons + { + return false; + } +- +- if (!cJSON_Compare(b_element, a_element, case_sensitive)) +- { +- return false; +- } + } + + return true; +-- +2.54.0 + diff --git a/meta-oe/recipes-devtools/cjson/cjson_1.7.19.bb b/meta-oe/recipes-devtools/cjson/cjson_1.7.19.bb index 5527e785e4..92d5dc349d 100644 --- a/meta-oe/recipes-devtools/cjson/cjson_1.7.19.bb +++ b/meta-oe/recipes-devtools/cjson/cjson_1.7.19.bb @@ -8,6 +8,7 @@ SRC_URI = "git://github.com/DaveGamble/cJSON.git;branch=master;protocol=https;ta file://run-ptest \ file://0001-allow-build-with-cmake-4.patch \ file://CVE-2026-87933.patch \ + file://CVE-2026-67216.patch \ file://0001-CMake-Install-to-relative-destinations.patch \ " SRCREV = "c859b25da02955fef659d658b8f324b5cde87be3"