]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.22] encoding/gob: cover missed cases when checking ignore depth
authorRoland Shoemaker <bracewell@google.com>
Fri, 3 May 2024 13:21:39 +0000 (09:21 -0400)
committerGopher Robot <gobot@golang.org>
Thu, 5 Sep 2024 14:55:22 +0000 (14:55 +0000)
commit2092294f2b097c5828f4eace6c98a322c1510b01
treef0abf3b1f740470fb114ae2d5b1492cf189e805e
parentb232596139dbe96a62edbe3a2a203e856bf556eb
[release-branch.go1.22] encoding/gob: cover missed cases when checking ignore depth

This change makes sure that we are properly checking the ignored field
recursion depth in decIgnoreOpFor consistently. This prevents stack
exhaustion when attempting to decode a message that contains an
extremely deeply nested struct which is ignored.

Thanks to Md Sakib Anwar of The Ohio State University (anwar.40@osu.edu)
for reporting this issue.

Updates #69139
Fixes #69144
Fixes CVE-2024-34156

Change-Id: Iacce06be95a5892b3064f1c40fcba2e2567862d6
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/1440
Reviewed-by: Russ Cox <rsc@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
(cherry picked from commit f0a11f9b3aaa362cb1d05e095e3c8d421d4f087f)
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/1580
Reviewed-by: Tatiana Bradley <tatianabradley@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/611182
TryBot-Bypass: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/encoding/gob/decode.go
src/encoding/gob/decoder.go
src/encoding/gob/gobencdec_test.go