From patchwork Tue Dec 1 05:30:29 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Patil, Omkar Abaji" X-Patchwork-Id: 106695 Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.5127.1796103065233666928 for ; Mon, 30 Nov 2026 21:31:05 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=lRzMYs1O; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.166.238, mailfrom: prvs=6795445c1e=omkarabaji.patil@windriver.com) Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B12JS8R1218320 for ; Mon, 30 Nov 2026 21:31:04 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=PPS06212021; bh=wqygXkDCqzf9h/849Y0cqxB14yZ7N6HD2LNO7ZSwzwc=; b=lRzMYs1ORAJl 1F3BY6AKZ2vgaJ726U38vj9LzJBJGg/B144jK9WZ2duSOnzuUX5wEwd066d2X1zf qdyF9UDWbd9v0dnZvprwtqmaCT3Q+Ei6iOAhwYIK2iZULzh4FDptyOP184MQmnmp 7kGQzu3QigTEyLbBLrqoYctrh20zRAEejQd/YCKtlWw0I4QBe8B0iM7Qpwqcp8GA PRLSFEtf8AXZkXGhl6Swf8WIEqqpAFPneOy5wYdftPUBsCjKAyI3PzL9fmGKs8D9 lDsKftJW48DCphqVt85k2qVnzw6v6F1UuulgZiYyCJ2ETUUwXxLGSE3qYmOgKYSH Ny5+PhMoQQ== Received: from bl0pr03cu003.outbound.protection.outlook.com (mail-eastusazon11022138.outbound.protection.outlook.com [52.101.53.138]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4j7u453u9r-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Mon, 30 Nov 2026 21:31:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZHEXU/Sj3ECnuM0nDQbAwNB15RKC4bOw4CW8mP8jWKbPOpVYyXJjfxsLlCe1/sCwM/JAQMzzF3hkQplYGCxu9fENDT3uR9dTV27QsjDu2Rd9J4gWEUtKT7XRjvQhHsInLieCC9HXQM0uyK2FR+ybapW8876P5nvxoHqlkihNG94SlkulNaaKckyeA4IDvz5aGk6eax3j343kY9DezQh624zbj6YNHeNliX0xCAYntNpmLXi7zSdJ6iAgXSfsWKn51jEu/S7zLFeiRTxgJ1hBIUyJeDrKmjl8mtUzx9ZX5oYYKczUH8g3ajJB+IYci9qQiQPI7GQptixM/brZilL8rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wqygXkDCqzf9h/849Y0cqxB14yZ7N6HD2LNO7ZSwzwc=; b=WO2vKY8WujIF5yfSai9bbS9MADBq2HWXfhF2wHoBwz52gt+q91CBiDcpk/ldbDOc0ycadw/0lTCBX0tVUMkQbfZG22UznMMjIL8wR5enRgVzdkSVs+bfOZ/S0Ck9aXNH12NgyW2mwYq4fIQw9M3HRkDTpBr8kOUPY58gJo6gASju5KwSQPrB8xqNQzWpnSBR5468eePzOIjhwZr1/UVMrudC+LvRfP3AGoIpt+6/chfsDoYgMeAP4q/0eHBpzi4KpRm38iakKYFqOHO1/KWCQul2CRFf7k/OjmPxtWadrcry3BV/1xOo8LH8Ucc2vvXZiBZ2lGmoLSUZ4ktP5YJkEQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=windriver.com; Received: from DM6PR11MB3243.namprd11.prod.outlook.com (2603:10b6:5:e::19) by SA3PR11MB7488.namprd11.prod.outlook.com (2603:10b6:806:313::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.10; Tue, 1 Dec 2026 05:31:02 +0000 Received: from DM6PR11MB3243.namprd11.prod.outlook.com ([fe80::6c83:d3c:7952:3ee1]) by DM6PR11MB3243.namprd11.prod.outlook.com ([fe80::6c83:d3c:7952:3ee1%4]) with mapi id 15.21.0662.007; Tue, 1 Dec 2026 05:31:02 +0000 From: Omkar Patil To: openembedded-core@lists.openembedded.org Subject: [blacksail][PATCH 6/8] libconvert-asn1-perl: fix CVE-2026-126956 Date: Tue, 1 Dec 2026 11:00:29 +0530 Message-Id: <20261201053031.3542039-7-OmkarAbaji.Patil@windriver.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20261201053031.3542039-1-OmkarAbaji.Patil@windriver.com> References: <20261201053031.3542039-1-OmkarAbaji.Patil@windriver.com> X-ClientProxiedBy: SE2P216CA0205.KORP216.PROD.OUTLOOK.COM (2603:1096:101:2c3::12) To DM6PR11MB3243.namprd11.prod.outlook.com (2603:10b6:5:e::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR11MB3243:EE_|SA3PR11MB7488:EE_ X-MS-Office365-Filtering-Correlation-Id: cc70aed2-770e-4f88-c53e-08df4f6c4973 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|23010399003|376014|52116014|38350700014|10067099003|260925022911599003|260925021911599003|260925021311599003|5023799004|11063799006|56012099006|261021121427099003|261009223027099003|261021123027099003|261102123227099003|261022113327099003|261022105027099003|261022075727099003|261028144727099003|261026121527099003|261026140227099003|22082099003|18002099003|6133799003|13003099007|3023799007; X-Microsoft-Antispam-Message-Info: rP7pA40Nu263EkRlfK8rJFiULqo6to1i/FwV98CQif0G8db3nr0tJyyngHYp5yIqbrGdSWthfx444JFpgTqor+HTbC1X085iz3ji75UxZKdge46///mqPzEE6Nyit5PetXrpwAWMcNAPoAdc6LTMOkFdjEN9buQJw7CYLmOUPSoTxEqjUewl8/rS1igb14ONctFojdgBNBMGiPXyK4SgqYDDCdPoLYUE0U35NRhf6+weDgExQMJLHh8N8Fju0tRnH4WFDncOJ7xyrzMHrl04Q8VxGzZDfgBrdBcmKFD1RXigFQr7M2hr1wDWelKsPXs07TUXk+NsOsa4SuCaCnhJGnU6Nxx1O8TnYCWIp5ERfGZRTaorpaPJ97iMhH/G/YtvCr7PFTd53lc4uJZ2jLRkZPv0qWg+dbbSOOStdOajtqiUVLom6fE6j6kduoZdENBL0UYy1g3yzjRDseRMuAglWaN8Kq627F0jNMK9u3OzaYLNSOLiqfkp8VxgW61LfcttvMNpmhC+f6BU38sM3TzQmCHKEYcskneffiwlVKKkQjlqLjkl3z8Yys7+L674cj5vEVABtsDcaaJ61m6bYEPMi62zBw24WMHrYP2Wcy4Ijo/kGz3QlHf5pAhBv+Q7hETiQWNutk4mVuqAoXGns26ea+jQTEmfTaytbgmLNcbRq6PoGWE0liSEnlSYOoqCdPdtXJsg0XnqYlTD7kTUVm01y2Wt+8NH+3KigpMxcfzpcjY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB3243.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(23010399003)(376014)(52116014)(38350700014)(10067099003)(260925022911599003)(260925021911599003)(260925021311599003)(5023799004)(11063799006)(56012099006)(261021121427099003)(261009223027099003)(261021123027099003)(261102123227099003)(261022113327099003)(261022105027099003)(261022075727099003)(261028144727099003)(261026121527099003)(261026140227099003)(22082099003)(18002099003)(6133799003)(13003099007)(3023799007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CBW56ovip1qvmbfskskx912a3D6bOy0q7Kqd/TqmbTezNnd+ogcJrM9wCsQUEB1lddgKI5eT4TE21YUwBOenIKticjpvLh6RCtef2foqsK3SFOXp6CAvK7LgIGThRqe90bqI6n6c+WJTiYxwHuS/gE6pKgWVCgGMJUdEy3Y4x7v4IZEz4KkE4a0eMg6Tp6eRlJfuauImchd7qD936vAo1B4GnGb6a2T52M0j8XMI27v+qCXN2L15dCyc4dS96K2V80hGxYanfolr/3m1zGdWP/OOnseg2g3P5ioD+gGtSeyvewm3LYAPQkNWm5JUGSNz4QmwcSUVKpiRzemppAzBB3YQKThuMjHwoVTotsRUyX/Sbwk5znnNxIFjpIXMOqKwBT+d6S8Ho0ic6TEf8SIkgNadon7hF6XPPRj5Nc50bd7ifvrzw1sdtpvQvklvpibP1wZC6FQOMZt4Eo6LfO+h+KXuhghCTYIa91mbdfMgATx91dxNev43fBD/Uai1LKQNKhhJ3jnMJwQfDYSwvwXFYzb/zZfSEGrH0+QZFCEWZK4F61zyor9+9IItUxPVIBGzEmhriwwelMOuRZ6+usSbVrGrJGMmlNnB4aYge+Sd8EzFnVo/vnJBwvTaa9liv0hNzMqPTcTpRqXZ/8Gv0AaZiRQpsvYq9OtU5u1Geb3xrs7j0XsbSa6oRnmp2I+E6Kk9tvYB7wdLHKbsC+DErFsyW5MfiWyUmpO6htc74mvdNsFUeKZpeg9tQZusM1AYnC0DpGZ7LZcS2wldHqCvN08P3nKH47Nkjd1dMtkuYrBMlNal1K/62nHljFFRHZ1F5tZ4LWgdt2RC1Zo3fbJBLftgEHH6xre6dD4teg/ed8dOCtQKbTG8PII4z1jTvIC2jKomIf7rLb3jnusToKn1GQhQ6OcGgako/BlHFMkU4/UpJaG/LO6sVI8hgToHlD3iREZ/BmyOIUqmByQoq3cBObS4S+tsmk4Ba4ivdFoRywtZO97+2HypFgWgmmPySZon1nVhZZLohMz3bMqApYWv3mC2ZkG2TkyQCf/Oc15y9zAjoPixItdMW2lea+yFbER6FWzG8gHPnYxJ7w9JFUJx9TGAGZZwVs2WMeXD1HcJvGWs0PHd9hl6SB5WyV5iRITtPUlv/m8V1yPA5IQstD/v/Q/mAy0vKxPUYnRtz0ElvetqaqIcn4CVt2pyx+H2rjBBBXbVK6I33RnXWEZQEVLY2RGQs2tjbWTTyoSnL1b6OxK0amBGYZJBilnV9Qmgz8pi+CmZBjYtPS2Mzy5AwGLDbrifMaWwQaZp0os5bD7qzzUmXJLfUkFrHOQZ2XYGWBadcQamyCTt3YfwmzsTZS6QipuwnooyZ55a7ekoWkEMyG1cDhMM9xPqt/mqzckKriwwjDLMMB1FcqIzGKSzQw6kpCLcRd03QNTHJv4vkSMuuCFg51TXZz6zHLOTheqObpzI6G4inljELnUjIA1k8E3U/ZcVE/ZnYGWqIik3VUSlZp0RYhwhIDZFyog6FcSW95XcylJIGAtwaHRtxlL4SwxqcWbKwiwAQ6bUFGkNKOQQvXOL2Tj2nW51uRRPCG9DYLPqTIxkRXXXZeM4dudJYqdTchC1JLh5c+Wcl0g8ov9bo6/eDnqFvvS0xZ813ic5D3/kTe6GB0jI+ndAe6S87ho6flon8DPJy0+4K3xX/K0VxQCGO0ikcO2508ir9E2orlWJ9ABBRx+gfAzIGOMveDa0z4nkbCxhPpa8iNWPf9AFIs/FZ3c= X-Exchange-RoutingPolicyChecked: B8X5QGf40O/rwxr4xIHOdfQKE6LsR6NIPwIwJ9GZoze7zut7qmw2+eSu4ddSqFVP45heOsV94lrE4lKqUJK4aBAVhVCxH/q4Dhl+MW7dgz+LNJFd3QmYi7EE2oA2ERezf8MulJKJazDZpYLQSBuJ9BiY7xK4T3iwGBLoZZ+fljb0ydjM0mnDeT9hMH70/7FTH1dje1jL4RkSbsY+f06OK3UMV2OVxz3GjM4SX5VBOK8rbcWDqDdkctEaEfUn9IYFKTOTf0oi05bffgTYRmYlBMtFp959mlwe2N3+fG5D/Hq1BVyxJpTPKjfKXXX46Wwip13pXbmwV5+Y6rLCHqspSg== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc70aed2-770e-4f88-c53e-08df4f6c4973 X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB3243.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2026 05:31:01.9982 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: zYspCjoTmYTg9EoSe4qF/aGOhGsbb79HQVzv1fV0dLs6zlzZQAUcht/7tTCsLfLwLUpvlU+4BBZ80NDst6/uBytbZxs4oapQqKoxQ0J2AwA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR11MB7488 X-Proofpoint-GUID: gM5A0drD5VvCSCftmDdt-TvVvTIAMvZd X-Proofpoint-ORIG-GUID: gM5A0drD5VvCSCftmDdt-TvVvTIAMvZd X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAxMDAyMSBTYWx0ZWRfX9FgKKyIHPI1Z ++cWoOdP3pgXjBQ6fwvPHZk04I7wjMhLknq6kWm4OLdb2fjrr+60gMBFSC6Hxkz2u/RIEZ8/FrG EOeHwhHlqEv36oHJtZYT+DkegAyGy0mM+pHOWrAHJ/fNfxyVG8kd X-Authority-Analysis: v=2.4 cv=NqBE4MdJ c=1 sm=1 tr=0 ts=6b0e5b98 cx=c_pps a=xT6463nTkSV8JPoIR211kA==:117 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=zJRp6_cAMcgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=bi6dqmuHe4P4UrxVR6um:22 a=HK-ge7EqtdluswH-FwHe:22 a=PYnjg3YJAAAA:8 a=NEAV23lmAAAA:8 a=t7CeM3EgAAAA:8 a=pGLkceISAAAA:8 a=3Dy-BMkK3IvYsCc2IQAA:9 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAxMDAyMSBTYWx0ZWRfX2Q3RBaLfmvFP RSa1dizhbNQngTuyYv0WGTSxjRl5RFYRB7gFcYBKYPM3Jo9JKHnsK3qLJZ16Sm6ljfI+lpGt3eY ZgNhUkDmbFgM+jjAjWs8fZnAiKhpaLZGh+orE9kZIrQncaJogH+2X8XraMJNrHu7Z8tr322NOR+ WNuXcfQ15UI32NvHzIH9vFGG8OgvaMXwbbBSIRcrNQ8TMx7iarJjOSv2+NR46KxOKYgZ0T3CBsm V7kfTlnG1hizyXpPuSjfeMc8caLbgOdIdDCKVxoVpIeObbYRCb/06Z3jFlxPBSl7y2Z8YC57nS3 w4CPHvJtZs22BGOwK3M2Gt8oCSeTUQ/iZiP6e0Y7aSEvf5eFodMO5E4lUZElV2ewEho2rQZ14nX RkDtvDdlAxGO96eRkupKG8fz3lOSISw4hQDv6bYd3PHS3npoX0Ow1re9/8zZK9FFACU781BwU7i MO3hrcNDvPnjvAWNQHQ== 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_01,2026-11-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 phishscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 adultscore=0 suspectscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612010021 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 05:31:21 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251672 Convert::ASN1 versions before 0.37 contain a flaw in constructed-form string decoding that can lead to memory exhaustion (DoS). A specially crafted ASN.1 message with deeply nested constructed strings can trigger unlimited recursion, causing excessive memory consumption and potentially crashing the application. Reference: [https://nvd.nist.gov/vuln/detail/cve-2026-126956] Upstream patch: [https://github.com/cpan-authors/perl-Convert-ASN1/commit/99a96139a322ba0a5183c7e40a8857f3550daace] Signed-off-by: Omkar Patil --- .../CVE-2026-126956.patch | 182 ++++++++++++++++++ .../perl/libconvert-asn1-perl_0.34.bb | 1 + 2 files changed, 183 insertions(+) create mode 100644 meta/recipes-extended/perl/libconvert-asn1-perl/CVE-2026-126956.patch diff --git a/meta/recipes-extended/perl/libconvert-asn1-perl/CVE-2026-126956.patch b/meta/recipes-extended/perl/libconvert-asn1-perl/CVE-2026-126956.patch new file mode 100644 index 0000000000..99bdc249d4 --- /dev/null +++ b/meta/recipes-extended/perl/libconvert-asn1-perl/CVE-2026-126956.patch @@ -0,0 +1,182 @@ +From a2d8d2dab891fd5e7795eb34f14e903b0c8e8795 Mon Sep 17 00:00:00 2001 +From: Timothy Legge +Date: Wed, 11 Nov 2026 22:25:08 +0000 +Subject: [PATCH 6/8] Fix CVE-2026-126956: constructed-form strings allow + unbounded recursion + +Add a configurable nesting depth limit at the top of _decode, covering +all recursive call sites: constructed strings, SEQUENCE, SET, EXPLICIT +tags, and CHOICE. Default is 99 (below Perl's built-in deep-recursion +warning threshold); zero disables; negative values are rejected. + +Propagate depth counter into ANY DEFINED BY sub-decoders. The handler +call at _decode.pm:148 invokes a separate ASN1 object whose $optn would +otherwise reset the counter to zero; seeding _decode_depth and +decode_max_depth with local before the call closes that bypass path. + +Rethrow the depth error from the eval around untagged CHOICE +alternatives. Treating it as a non-match made each level retry every +alternative, so nested CHOICEs could cost up to 2**max_depth work. + + $asn->configure(decode => { max_depth => N }); + +CVE: CVE-2026-126956 +Upstream-Status: Backport [https://github.com/cpan-authors/perl-Convert-ASN1/commit/99a96139a322ba0a5183c7e40a8857f3550daace] +Signed-off-by: Omkar Patil +--- + lib/Convert/ASN1.pod | 13 +++++++ + lib/Convert/ASN1/_decode.pm | 25 ++++++++++++-- + t/26dec_depth_limit.t | 67 +++++++++++++++++++++++++++++++++++++ + 3 files changed, 102 insertions(+), 3 deletions(-) + create mode 100644 t/26dec_depth_limit.t + +diff --git a/lib/Convert/ASN1.pod b/lib/Convert/ASN1.pod +index 898f124..e52d8b9 100644 +--- a/lib/Convert/ASN1.pod ++++ b/lib/Convert/ASN1.pod +@@ -185,6 +185,19 @@ rejected as invalid. + $asn->configure(decode => { max_int_len => 4096 }); # allow up to 32767-bit + $asn->configure(decode => { max_int_len => 0 }); # no limit (not recommended) + ++=item max_depth ++ ++Maximum number of nested C<_decode> calls permitted before decoding is aborted ++with an error. Each SEQUENCE, SET, EXPLICIT tag, constructed string, or CHOICE ++without a tag adds one level. Prevents a remote peer from causing unbounded ++stack growth by sending deeply nested structures. Defaults to C<99>, which is ++sufficient for any real-world X.509 certificate, LDAP message, or SNMP PDU, ++and stays below Perl's built-in deep-recursion warning threshold of 100. ++Set to C<0> to disable the limit; negative values are rejected as invalid. ++ ++ $asn->configure(decode => { max_depth => 256 }); # allow deeper nesting ++ $asn->configure(decode => { max_depth => 0 }); # no limit (not recommended) ++ + =item null + + The value to decode ASN.1 NULL types into. +diff --git a/lib/Convert/ASN1/_decode.pm b/lib/Convert/ASN1/_decode.pm +index 3e1978d..0450471 100644 +--- a/lib/Convert/ASN1/_decode.pm ++++ b/lib/Convert/ASN1/_decode.pm +@@ -44,6 +44,13 @@ my @ctr; + + sub _decode { + my ($optn, $ops, $stash, $pos, $end, $seqof, $larr) = @_; ++ ++ my $max_depth = exists $optn->{decode_max_depth} ? $optn->{decode_max_depth} : 99; ++ local $optn->{_decode_depth} = ($optn->{_decode_depth} || 0) + 1; ++ die "decode: max_depth must not be negative\n" if $max_depth < 0; ++ die "decode error (nesting depth limit exceeded)\n" ++ if $max_depth > 0 && $optn->{_decode_depth} > $max_depth; ++ + my $idx = 0; + + # we try not to copy the input buffer at any time +@@ -137,8 +144,16 @@ sub _decode { + $handler ||= $optn->{handlers}{$op->[cVAR]}{$stash->{$op->[cDEFINE]}}; + } + +- ($seqof ? $seqof->[$idx++] : ref($stash) eq 'SCALAR' ? $$stash : $stash->{$var}) +- = $handler ? $handler->decode(substr($buf,$pos,$len)) : substr($buf,$pos,$len); ++ if ($handler) { ++ local $handler->{options}{_decode_depth} = $optn->{_decode_depth}; ++ local $handler->{options}{decode_max_depth} = $max_depth ++ unless exists $handler->{options}{decode_max_depth}; ++ ($seqof ? $seqof->[$idx++] : ref($stash) eq 'SCALAR' ? $$stash : $stash->{$var}) ++ = $handler->decode(substr($buf,$pos,$len)); ++ } else { ++ ($seqof ? $seqof->[$idx++] : ref($stash) eq 'SCALAR' ? $$stash : $stash->{$var}) ++ = substr($buf,$pos,$len); ++ } + + $pos += $len; + +@@ -206,7 +221,11 @@ sub _decode { + + @{$nstash}{keys %tmp_stash} = values %tmp_stash; + +- } or next; ++ } or do { ++ die $@ if $@ =~ /nesting depth limit exceeded/; ++ next; ++ }; ++ + + $pos = $npos+$len+$indef; + +diff --git a/t/26dec_depth_limit.t b/t/26dec_depth_limit.t +new file mode 100644 +index 0000000..dba346e +--- /dev/null ++++ b/t/26dec_depth_limit.t +@@ -0,0 +1,67 @@ ++#!/usr/bin/perl ++# Tests for _decode nesting depth limit (F7). ++ ++use strict; ++use warnings; ++use lib 'lib'; ++use Convert::ASN1 qw(asn_encode_length); ++BEGIN { require './t/funcs.pl' } ++ ++print "1..12\n"; ++ ++# Build a schema with $depth levels of SEQUENCE nesting around an INTEGER. ++sub make_schema { ++ my $depth = shift; ++ my $s = 'n INTEGER'; ++ $s = "x SEQUENCE { $s }" for 1 .. $depth; ++ return $s; ++} ++ ++# Build matching BER input: $depth levels of SEQUENCE wrapping INTEGER value $v. ++sub make_input { ++ my ($depth, $v) = @_; ++ my $buf = "\x02\x01" . chr($v); ++ $buf = pack("C", 0x30) . asn_encode_length(length $buf) . $buf for 1 .. $depth; ++ return $buf; ++} ++ ++my ($asn, $ret); ++btest 1, $asn = Convert::ASN1->new; ++ ++# --- 2-3: 2 levels passes max_depth => 3 --- ++$asn->configure(decode => { max_depth => 3 }); ++btest 2, $asn->prepare(make_schema(2)) or warn $asn->error; ++btest 3, defined($asn->decode(make_input(2, 7))) or warn $asn->error; ++ ++# --- 4-6: 3 levels exceeds max_depth => 3 (depth reaches 4) --- ++btest 4, $asn->prepare(make_schema(3)) or warn $asn->error; ++btest 5, !defined($asn->decode(make_input(3, 7))); ++btest 6, ($asn->error || '') =~ /depth/; ++ ++# --- 7: max_depth => 0 disables the limit --- ++$asn->configure(decode => { max_depth => 0 }); ++btest 7, defined($asn->decode(make_input(3, 7))) or warn $asn->error; ++ ++# --- 8: raising max_depth to 10 allows 3 levels --- ++$asn->configure(decode => { max_depth => 10 }); ++btest 8, defined($asn->decode(make_input(3, 7))) or warn $asn->error; ++ ++# --- 9: negative max_depth is a hard error --- ++$asn->configure(decode => { max_depth => -1 }); ++btest 9, !defined($asn->decode(make_input(3, 7))) && ($asn->error || '') =~ /max_depth must not be negative/; ++ ++# --- 10-12: depth error inside an untagged CHOICE alternative aborts the decode ++# rather than being treated as a non-match; otherwise each level retries every ++# alternative and the work grows as 2**max_depth --- ++{ ++ my $levels = 30; ++ my $schema = "L0 ::= INTEGER\n"; ++ $schema .= "L$_ ::= CHOICE { a L" . ($_ - 1) . ", b L" . ($_ - 1) . " }\n" for 1 .. $levels; ++ my $choice = Convert::ASN1->new; ++ $choice->configure(decode => { max_depth => 22 }); ++ btest 10, $choice->prepare($schema) or warn $choice->error; ++ my $top = $choice->find("L$levels"); ++ my $t = time; ++ btest 11, !defined($top->decode("\x04\x01\x41")) && ($top->error || '') =~ /depth/; ++ btest 12, time - $t < 2; ++} +-- +2.40.0 + diff --git a/meta/recipes-extended/perl/libconvert-asn1-perl_0.34.bb b/meta/recipes-extended/perl/libconvert-asn1-perl_0.34.bb index 0525e73e74..7a66fdc5b1 100644 --- a/meta/recipes-extended/perl/libconvert-asn1-perl_0.34.bb +++ b/meta/recipes-extended/perl/libconvert-asn1-perl_0.34.bb @@ -11,6 +11,7 @@ SRC_URI = "${CPAN_MIRROR}/authors/id/T/TI/TIMLEGGE/Convert-ASN1-${PV}.tar.gz \ file://CVE-2026-126576.patch \ file://CVE-2026-126682.patch \ file://CVE-2026-126819.patch \ + file://CVE-2026-126956.patch \ " SRC_URI[sha256sum] = "a628d7c9d390568fb76359975fa03f626ce57f10dc17980e8e3587d7713e4ee7"