]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.13-security] encoding/binary: read at most MaxVarintLen64 bytes...
authorKatie Hockman <katie@golang.org>
Tue, 4 Aug 2020 15:45:32 +0000 (11:45 -0400)
committerKatie Hockman <katiehockman@google.com>
Thu, 6 Aug 2020 13:03:23 +0000 (13:03 +0000)
commitec5b63a6a2b6205cc204e9ce856e7517a1b989d2
tree5f46fe2493b37aee2ab7aed2610c0bb01eeb0b79
parentd3ba94164a1c404a01369fb54ddd4f5b94d91348
[release-branch.go1.13-security] encoding/binary: read at most MaxVarintLen64 bytes in ReadUvarint

This CL ensures that ReadUvarint consumes only a limited
amount of input (instead of an unbounded amount).

On some inputs, ReadUvarint could read an arbitrary number
of bytes before deciding to return an overflow error.
After this CL, ReadUvarint returns that same overflow
error sooner, after reading at most MaxVarintLen64 bytes.

Fix authored by Robert Griesemer and Filippo Valsorda.

Thanks to Diederik Loerakker, Jonny Rhea, Raúl Kripalani,
and Preston Van Loon for reporting this.

Fixes CVE-2020-16845

Change-Id: Ie0cb15972f14c38b7cf7af84c45c4ce54909bb8f
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/812099
Reviewed-by: Filippo Valsorda <valsorda@google.com>
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/812324
src/encoding/binary/varint.go
src/encoding/binary/varint_test.go