summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/go/go-1.14.inc
diff options
context:
space:
mode:
authorVivek Kumbhar <vkumbhar@mvista.com>2023-04-28 20:14:30 +0530
committerSteve Sakoman <steve@sakoman.com>2023-04-28 06:07:30 -1000
commitdaa6aa9c7198a07322f1828a9db457fec86191cf (patch)
tree29357d6ed60967e7528842b7d69f6662e1ed5acd /meta/recipes-devtools/go/go-1.14.inc
parent08ffa2437967a642a4c8e35e2158bb369454764a (diff)
downloadopenembedded-core-contrib-daa6aa9c7198a07322f1828a9db457fec86191cf.tar.gz
go: fix CVE-2023-24534 denial of service from excessive memory allocation
A parsed MIME header is a map[string][]string. In the common case, a header contains many one-element []string slices. To avoid allocating a separate slice for each key, ReadMIMEHeader looks ahead in the input to predict the number of keys that will be parsed, and allocates a single []string of that length. The individual slices are then allocated out of the larger one. The prediction of the number of header keys was done by counting newlines in the input buffer, which does not take into account header continuation lines (where a header key/value spans multiple lines) or the end of the header block and the start of the body. This could lead to a substantial amount of overallocation, for example when the body consists of nothing but a large block of newlines. Fix header key count prediction to take into account the end of the headers (indicated by a blank line) and continuation lines (starting with whitespace). Thanks to Jakob Ackermann (@das7pad) for reporting this issue. Fixes CVE-2023-24534 For #58975 Fixes #59267 Signed-off-by: Vivek Kumbhar <vkumbhar@mvista.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-devtools/go/go-1.14.inc')
-rw-r--r--meta/recipes-devtools/go/go-1.14.inc1
1 files changed, 1 insertions, 0 deletions
diff --git a/meta/recipes-devtools/go/go-1.14.inc b/meta/recipes-devtools/go/go-1.14.inc
index b1d7bc155a..3b99b8fe7e 100644
--- a/meta/recipes-devtools/go/go-1.14.inc
+++ b/meta/recipes-devtools/go/go-1.14.inc
@@ -57,6 +57,7 @@ SRC_URI += "\
file://CVE-2022-41722-2.patch \
file://CVE-2020-29510.patch \
file://CVE-2023-24537.patch \
+ file://CVE-2023-24534.patch \
"
SRC_URI_append_libc-musl = " file://0009-ld-replace-glibc-dynamic-linker-with-musl.patch"