]> Cypherpunks.ru repositories - gostls13.git/commit
[release-branch.go1.22] net/textproto, mime/multipart: avoid unbounded read in MIME...
authorDamien Neil <dneil@google.com>
Tue, 16 Jan 2024 23:37:52 +0000 (15:37 -0800)
committerGopher Robot <gobot@golang.org>
Tue, 5 Mar 2024 16:43:51 +0000 (16:43 +0000)
commit041a47712e765e94f86d841c3110c840e76d8f82
treeec75f725b4faa66b4f41ff9a5fed4cdd1db899d5
parent3a855208e3efed2e9d7c20ad023f1fa78afcc0be
[release-branch.go1.22] net/textproto, mime/multipart: avoid unbounded read in MIME header

mime/multipart.Reader.ReadForm allows specifying the maximum amount
of memory that will be consumed by the form. While this limit is
correctly applied to the parsed form data structure, it was not
being applied to individual header lines in a form.

For example, when presented with a form containing a header line
that never ends, ReadForm will continue to read the line until it
runs out of memory.

Limit the amount of data consumed when reading a header.

Fixes CVE-2023-45290
Fixes #65850
For #65383

Change-Id: I7f9264d25752009e95f6b2c80e3d76aaf321d658
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/2134435
Reviewed-by: Roland Shoemaker <bracewell@google.com>
Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/2174345
Reviewed-by: Carlos Amedee <amedee@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/569237
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
src/mime/multipart/formdata_test.go
src/net/textproto/reader.go
src/net/textproto/reader_test.go