From patchwork Wed Aug 19 11:10:45 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Hetvi Thakar -X (hthakar - E INFOCHIPS PRIVATE LIMITED at Cisco)" X-Patchwork-Id: 95762 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15AACC5DF89 for ; Wed, 19 Aug 2026 11:11:07 +0000 (UTC) Received: from alln-iport-6.cisco.com (alln-iport-6.cisco.com [173.37.142.93]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.4703.1787137859782424526 for ; Wed, 19 Aug 2026 04:11:01 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: message contains an insecure body length tag" header.i=@cisco.com header.s=iport01 header.b=jwFwQS/v; spf=pass (domain: cisco.com, ip: 173.37.142.93, mailfrom: hthakar@cisco.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cisco.com; i=@cisco.com; l=5097; q=dns/txt; s=iport01; t=1787137861; x=1788347461; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RyPPcARkdfDJZgfxAhvfUl8h3r9xGa61C7RhmshIdZo=; b=jwFwQS/vIR46+dPEVHLdsAGoYQpNtvfpAfBZ/T/wyKSkIfrB5lNN+ujh eyn1BP0ztpRqdS+CLmzL3jSH0958U6zlBGKnJVb3BiY5V9dUFAhFThVrJ +RW9hTxvfqZFQ33t9WHA8v4x6zH+WfaR9APnubcpRD6fWcDDmddXgtJyv bF7IBB4GcrOvnXtPTqd5j34jI9TKg+IUDcfX5GLfh4uc4ybPp/sg+0ehu OE6I0UzYUIIFFgNBJFwwtLIa8c/rzS/hxPOWNFoQwUj/hCt31TIt7Z1w3 V0o6fhekOn2LEGlwoA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0rJD1Fs sFbcTQHV0XW7w626OrTpuhEj8AnKozveYgYoHwllWqfBvc9SpeFSKLPjTNa9G5v3YYVQ7CHO YxANWIHgBfoO3WjPn8XFJI3n+6yrnL+aDZf7lmSoMLb5kCDlVUvgeCzaYW9ltqiffRqkn6bu jn91m2hAk0YJoyx0zXcyyf57gPItWahMG4IL5W/7vNsjViZy2AfBRFTWValrP2Rjk+lR8kZL FQZ/Ccrp6U++EGnCN7nUHWFTGWstxoYXZ9UVuY98gzIkvGS6AeCDW9CRTlEADA7iPILqfUR/ gfht7vU6fZH69V5lVr1Gm+okA6P IronPort-HdrOrdr: A9a23:nHxljq2RSY4U2+kict1NOAqjBGwkLtp133Aq2lEZdPWaSKOlfq eV7ZImPH7P+VEssR4b+OxoVJPsfZqYz+8W3WBzB8bHYOCZgguVxehZhOOIqQEIWReOk9K1vp 0PT0ERMrHN5HFB/L/HCXGDYrUd6ejC1ry0juHDyHooZwRrZ6Z8qzpdMG+gYzVLrM0sP+tCKH JajfA33AadRQ== X-Talos-CUID: 9a23:3cnmlWvh+KXAqUtOUROnXYsb6It5fSDe4nPwJnakMjpMFLbSdBzJ/Kldxp8= X-Talos-MUID: 9a23:rMRZQQzAi9rha3nwasCI+nNE2qGaqJyfN0w1koldgOCNbSwsOSXNoi64G7Zyfw== X-IronPort-Anti-Spam-Filtered: true X-IronPort-AV: E=Sophos;i="6.25,231,1779148800"; d="scan'208";a="811690617" Received: from alln-l-core-03.cisco.com ([173.36.16.140]) by alln-iport-6.cisco.com with ESMTP/TLS/TLS_AES_256_GCM_SHA384; 19 Aug 2026 11:10:58 +0000 Received: from sjc-ads-5471.cisco.com (sjc-ads-5471.cisco.com [10.28.23.235]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "ciscoit-managed-infra-smtp-auth.cisco.com", Issuer "Internal Private TLS SubCA" (verified OK)) by alln-l-core-03.cisco.com (Postfix) with ESMTPS id 9A5A9180001CF; Wed, 19 Aug 2026 11:10:58 +0000 (GMT) Received: by sjc-ads-5471.cisco.com (Postfix, from userid 1887505) id 3E03DCC12A6; Wed, 19 Aug 2026 04:10:58 -0700 (PDT) From: "Hetvi Thakar -X (hthakar - E INFOCHIPS PRIVATE LIMITED at Cisco)" To: openembedded-devel@lists.openembedded.org Cc: xe-linux-external@cisco.com, Hetvi Thakar Subject: [meta-oe][scarthgap][PATCH 3/5] libssh: Fix CVE-2026-59846 Date: Wed, 19 Aug 2026 04:10:45 -0700 Message-Id: <20260819111047.44043-4-hthakar@cisco.com> X-Mailer: git-send-email 2.35.6 In-Reply-To: <20260819111047.44043-1-hthakar@cisco.com> References: <20260819111047.44043-1-hthakar@cisco.com> MIME-Version: 1.0 X-Auto-Response-Suppress: DR, OOF, AutoReply X-Outbound-Client-TLS: VERIFIED;sjc-ads-5471.cisco.com [10.28.23.235];TLSv1.3;TLS_AES_256_GCM_SHA384;256;ciscoit-managed-infra-smtp-auth.cisco.com X-Outbound-SMTP-Client: 10.28.23.235, sjc-ads-5471.cisco.com X-Outbound-Node: alln-l-core-03.cisco.com List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 19 Aug 2026 11:11:07 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/129350 From: Hetvi Thakar libssh 0.10.6 predates the username-validation helper used by the stable-0.11 fix, so the upstream commit in [1] cannot be applied as-is. Adapt the same dangerous-character check directly at the ProxyCommand %r expansion sink and add focused regression coverage. The upstream advisory [2] identifies libssh 0.11.5 and 0.12.1 as the fixed releases. [1] https://gitlab.com/libssh/libssh-mirror/-/commit/56ce3c193eb06af5bf3b07ec0b4c7308b5c72130 [2] https://www.libssh.org/security/advisories/CVE-2026-59846.txt Signed-off-by: Hetvi Thakar --- .../libssh/libssh/CVE-2026-59846.patch | 87 +++++++++++++++++++ .../recipes-support/libssh/libssh_0.10.6.bb | 5 ++ 2 files changed, 92 insertions(+) create mode 100644 meta-oe/recipes-support/libssh/libssh/CVE-2026-59846.patch diff --git a/meta-oe/recipes-support/libssh/libssh/CVE-2026-59846.patch b/meta-oe/recipes-support/libssh/libssh/CVE-2026-59846.patch new file mode 100644 index 0000000000..9c626d113d --- /dev/null +++ b/meta-oe/recipes-support/libssh/libssh/CVE-2026-59846.patch @@ -0,0 +1,87 @@ +From 19fe4c9fc7b3bd3553250bf9ddea03ed1dcf044f Mon Sep 17 00:00:00 2001 +From: Jakub Jelen +Date: Thu, 2 Apr 2026 15:39:25 +0200 +Subject: [PATCH] CVE-2026-59846 Block shell metacharacters from usernames +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When an attacker could sneak the dollar sign or backslash into the username +expanded for example in proxy command, it can result in printing environment +variables that might contain secrets. + +This is a fixup of CVE-2023-6004 which fixed this for hostnames, but these +two metacharacters were left out from the username filter. + +This keeps the list in one place to simplify maintenance. + +Signed-off-by: Jakub Jelen +Reviewed-by: Pavol Žáčik +(cherry picked from commit 6309df220e3431deb41946f892f4bb5af8b59dba) + +CVE: CVE-2026-59846 +Upstream-Status: Backport [https://git.libssh.org/projects/libssh.git/commit/?id=56ce3c193eb06af5bf3b07ec0b4c7308b5c72130] + +Backport Changes: +- libssh 0.10.6 predates ssh_check_username_syntax() and the centralized + SSH_DANGEROUS_SHELL_CHARS definition, so enforce the same character list + directly at the %r expansion sink in ssh_path_expand_escape(). +- Add focused regression coverage to the existing path-expansion unit test + for dollar-sign, backslash, and command-separator usernames. + +(cherry picked from commit 56ce3c193eb06af5bf3b07ec0b4c7308b5c72130) +Signed-off-by: Hetvi Thakar +--- + src/misc.c | 9 +++++++++ + tests/unittests/torture_misc.c | 18 ++++++++++++++++++ + 2 files changed, 27 insertions(+) + +diff --git a/src/misc.c b/src/misc.c +index e78c92ba..15b427d7 100644 +--- a/src/misc.c ++++ b/src/misc.c +@@ -1262,6 +1262,15 @@ char *ssh_path_expand_escape(ssh_session session, const char *s) + break; + case 'r': + if (session->opts.username) { ++ if (strpbrk(session->opts.username, ++ "'`\";&<>|(){}$\\,") != NULL) { ++ ssh_set_error(session, ++ SSH_FATAL, ++ "Invalid shell metacharacter in username"); ++ free(buf); ++ free(r); ++ return NULL; ++ } + x = strdup(session->opts.username); + } else { + ssh_set_error(session, SSH_FATAL, +diff --git a/tests/unittests/torture_misc.c b/tests/unittests/torture_misc.c +index 82d6cf16..66d392ed 100644 +--- a/tests/unittests/torture_misc.c ++++ b/tests/unittests/torture_misc.c +@@ -194,6 +194,24 @@ static void torture_path_expand_escape(void **state) { + assert_non_null(e); + assert_string_equal(e, "guru/meditation/222/by/root"); + ssh_string_free_char(e); ++ ++ free(session->opts.username); ++ session->opts.username = strdup("root$HOME"); ++ assert_non_null(session->opts.username); ++ e = ssh_path_expand_escape(session, s); ++ assert_null(e); ++ ++ free(session->opts.username); ++ session->opts.username = strdup("root\\user"); ++ assert_non_null(session->opts.username); ++ e = ssh_path_expand_escape(session, s); ++ assert_null(e); ++ ++ free(session->opts.username); ++ session->opts.username = strdup("root;id"); ++ assert_non_null(session->opts.username); ++ e = ssh_path_expand_escape(session, s); ++ assert_null(e); + } + + static void torture_path_expand_known_hosts(void **state) { diff --git a/meta-oe/recipes-support/libssh/libssh_0.10.6.bb b/meta-oe/recipes-support/libssh/libssh_0.10.6.bb index a9d7729f2c..8e86073fd3 100644 --- a/meta-oe/recipes-support/libssh/libssh_0.10.6.bb +++ b/meta-oe/recipes-support/libssh/libssh_0.10.6.bb @@ -34,6 +34,11 @@ SRC_URI = "git://git.libssh.org/projects/libssh.git;protocol=https;branch=stable file://CVE-2026-0965.patch \ file://CVE-2026-59843.patch \ file://CVE-2026-59844.patch \ +<<<<<<< HEAD +======= + file://CVE-2026-59845.patch \ + file://CVE-2026-59846.patch \ +>>>>>>> b782f294a0 (libssh: Fix CVE-2026-59846) " SRCREV = "10e09e273f69e149389b3e0e5d44b8c221c2e7f6"