From patchwork Sat Sep 30 19:40:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 31454 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 F3A34E748E3 for ; Sat, 30 Sep 2023 19:40:34 +0000 (UTC) Received: from mail-oa1-f41.google.com (mail-oa1-f41.google.com [209.85.160.41]) by mx.groups.io with SMTP id smtpd.web11.47408.1696102832553721750 for ; Sat, 30 Sep 2023 12:40:32 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@sakoman-com.20230601.gappssmtp.com header.s=20230601 header.b=IzDZgxx9; spf=softfail (domain: sakoman.com, ip: 209.85.160.41, mailfrom: steve@sakoman.com) Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-1e113555a47so1610518fac.2 for ; Sat, 30 Sep 2023 12:40:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakoman-com.20230601.gappssmtp.com; s=20230601; t=1696102831; x=1696707631; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Dq3HLpYKXpFoH0afaMkpElxQEkRKzF0wcyY8etLlYY4=; b=IzDZgxx9R5f7mEsuD0S0LvFzzNBC0DgxxdjREuOew/URUcb/LfE10RQLMVFft0WhYd 0aOCFT4qGx9vGYMgKNBIV4nBlDd1lbSpRd6UX/It8w6rjebBfmYEPwwuoBwIiYQS+Fqe PunflYGkI9JWXE8lUtuam6LsiZFORHT14wuyEGanpwe71d2LxmppkPMEtQp+T16WUZWo 9obHBPdvS1xxM4bVPQZtyEMqKxRmDZt9SFv72EX7YLkCziwRHFB/nK85j8J6f2ycExzC 3S1JMXeA3nwXdNjk3y/Oi3+Z5eeDrI9q1d6VuzwLyiKfUi+4FNwqNko9dFtJ5UVgFVEM atiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696102831; x=1696707631; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Dq3HLpYKXpFoH0afaMkpElxQEkRKzF0wcyY8etLlYY4=; b=ROeb+TQqJZZSC7bHx1H1AdWhKlS/4eDgKLhtx20RQW0RnHdWwaU2K4wLy6ooclAKhI MoHIXjKaELox1Np9A9T6HEIBYTyGQ/Is+x7dFfBV/fjB5ncFH1DVreafbXxbOWtIrLHS ka4nVkW9/BawikjOebuqQGAtlr2OovNN0KmzAVKAZPFGRaBTrBdlaFOvh8H7u/go0HlF /VRJmVeR0v4KjXobXJab6oO/EZ2z4X46LT4ZFSC/Yze9wYwEm0UHhbSROxusoXM5B09y aFjtLpzh6HWcEQRAOaIi7amw+eE3CsU4syNcHau909nab5y6nyjMshW6qwhAx0PwlMvT 5SIw== X-Gm-Message-State: AOJu0YxIV5/5WhhIzLVVYXzwqc85grAx2NjXlFUODfpHrvXtv1oBS81F SOZmPwsSxG/d+mv6NDdnGPRMhqt4SosXPbP+6Ho= X-Google-Smtp-Source: AGHT+IH0Jd/iWGUZxS1P0qn1gG8Gmrh5s2HqlPXI7wIi3azD6aU7EvAfpKw+3Ib5HlWk/Heasvs6UQ== X-Received: by 2002:a05:6871:709:b0:1bb:4606:5be with SMTP id f9-20020a056871070900b001bb460605bemr8704682oap.9.1696102831250; Sat, 30 Sep 2023 12:40:31 -0700 (PDT) Received: from hexa.lan (dhcp-72-234-106-30.hawaiiantel.net. [72.234.106.30]) by smtp.gmail.com with ESMTPSA id p2-20020a62ab02000000b006936d053677sm2880011pff.133.2023.09.30.12.40.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 12:40:30 -0700 (PDT) From: Steve Sakoman To: openembedded-core@lists.openembedded.org Subject: [OE-core][dunfell 07/13] go: Fix CVE-2023-39318 and CVE-2023-39319 Date: Sat, 30 Sep 2023 09:40:04 -1000 Message-Id: <8de380d765d8f47a961c6e45eba1cfa4d2feb68f.1696102675.git.steve@sakoman.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sat, 30 Sep 2023 19:40:34 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/188472 From: Siddharth Doshi Upstream-Status: Backport from [https://github.com/golang/go/commit/023b542edf38e2a1f87fcefb9f75ff2f99401b4c] CVE: CVE-2023-39318 Upstream-Status: Backport from [https://github.com/golang/go/commit/2070531d2f53df88e312edace6c8dfc9686ab2f5] CVE: CVE-2023-39319 Signed-off-by: Siddharth Doshi Signed-off-by: Steve Sakoman --- meta/recipes-devtools/go/go-1.14.inc | 2 + .../go/go-1.14/CVE-2023-39318.patch | 238 ++++++++++++++++++ .../go/go-1.14/CVE-2023-39319.patch | 230 +++++++++++++++++ 3 files changed, 470 insertions(+) create mode 100644 meta/recipes-devtools/go/go-1.14/CVE-2023-39318.patch create mode 100644 meta/recipes-devtools/go/go-1.14/CVE-2023-39319.patch diff --git a/meta/recipes-devtools/go/go-1.14.inc b/meta/recipes-devtools/go/go-1.14.inc index 784b502f46..be63f64825 100644 --- a/meta/recipes-devtools/go/go-1.14.inc +++ b/meta/recipes-devtools/go/go-1.14.inc @@ -77,6 +77,8 @@ SRC_URI += "\ file://CVE-2023-24536_1.patch \ file://CVE-2023-24536_2.patch \ file://CVE-2023-24536_3.patch \ + file://CVE-2023-39318.patch \ + file://CVE-2023-39319.patch \ " SRC_URI_append_libc-musl = " file://0009-ld-replace-glibc-dynamic-linker-with-musl.patch" diff --git a/meta/recipes-devtools/go/go-1.14/CVE-2023-39318.patch b/meta/recipes-devtools/go/go-1.14/CVE-2023-39318.patch new file mode 100644 index 0000000000..20e70c0485 --- /dev/null +++ b/meta/recipes-devtools/go/go-1.14/CVE-2023-39318.patch @@ -0,0 +1,238 @@ +From 023b542edf38e2a1f87fcefb9f75ff2f99401b4c Mon Sep 17 00:00:00 2001 +From: Roland Shoemaker +Date: Thu, 3 Aug 2023 12:24:13 -0700 +Subject: [PATCH] [release-branch.go1.20] html/template: support HTML-like + comments in script contexts + +Per Appendix B.1.1 of the ECMAScript specification, support HTML-like +comments in script contexts. Also per section 12.5, support hashbang +comments. This brings our parsing in-line with how browsers treat these +comment types. + +Thanks to Takeshi Kaneko (GMO Cybersecurity by Ierae, Inc.) for +reporting this issue. + +Fixes #62196 +Fixes #62395 +Fixes CVE-2023-39318 + +Change-Id: Id512702c5de3ae46cf648e268cb10e1eb392a181 +Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1976593 +Run-TryBot: Roland Shoemaker +Reviewed-by: Tatiana Bradley +Reviewed-by: Damien Neil +Reviewed-by: Dmitri Shuralyov +Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/2014620 +Reviewed-on: https://go-review.googlesource.com/c/go/+/526098 +Run-TryBot: Cherry Mui +TryBot-Result: Gopher Robot + +Upstream-Status: Backport from [https://github.com/golang/go/commit/023b542edf38e2a1f87fcefb9f75ff2f99401b4c] +CVE: CVE-2023-39318 +Signed-off-by: Siddharth Doshi +--- + src/html/template/context.go | 6 ++- + src/html/template/escape.go | 5 +- + src/html/template/escape_test.go | 10 ++++ + src/html/template/state_string.go | 4 +- + src/html/template/transition.go | 80 ++++++++++++++++++++----------- + 5 files changed, 72 insertions(+), 33 deletions(-) + +diff --git a/src/html/template/context.go b/src/html/template/context.go +index 0b65313..4eb7891 100644 +--- a/src/html/template/context.go ++++ b/src/html/template/context.go +@@ -124,6 +124,10 @@ const ( + stateJSBlockCmt + // stateJSLineCmt occurs inside a JavaScript // line comment. + stateJSLineCmt ++ // stateJSHTMLOpenCmt occurs inside a JavaScript HTML-like comment. ++ stateJSHTMLCloseCmt + // stateCSS occurs inside a