]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.17] encoding/gob: add a depth limit for ignored fields
authorRoland Shoemaker <bracewell@google.com>
Tue, 7 Jun 2022 20:00:43 +0000 (13:00 -0700)
committerMichael Knyszek <mknyszek@google.com>
Tue, 12 Jul 2022 15:20:44 +0000 (15:20 +0000)
commitcd54600b866db0ad068ab8df06c7f5f6cb55c9b3
treeea9231caee749516c4187db0210cac03346a9ce6
parent76f8b7304d1f7c25834e2a0cc9e88c55276c47df
[release-branch.go1.17] encoding/gob: add a depth limit for ignored fields

Enforce a nesting limit of 10,000 for ignored fields during decoding
of messages. This prevents the possibility of triggering stack
exhaustion.

Fixes #53709
Updates #53615
Fixes CVE-2022-30635

Change-Id: I05103d06dd5ca3945fcba3c1f5d3b5a645e8fb0f
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1484771
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
(cherry picked from commit 55e8f938d22bfec29cc9dc9671044c5a41d1ea9c)
Reviewed-on: https://go-review.googlesource.com/c/go/+/417074
Run-TryBot: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
src/encoding/gob/decode.go
src/encoding/gob/gobencdec_test.go