]> Cypherpunks repositories - gostls13.git/commitdiff
encoding/gob: add top level security doc
authorRoland Shoemaker <roland@golang.org>
Wed, 28 Sep 2022 21:41:30 +0000 (14:41 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 29 Sep 2022 00:30:21 +0000 (00:30 +0000)
Add a slightly expanded version of the Decoder type comment to the top
level package doc, which explains that this package is not designed
to be hardened against adversarial inputs.

Change-Id: I8b83433838c8235eb06ded99041fdf726c811ee5
Reviewed-on: https://go-review.googlesource.com/c/go/+/436096
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Roland Shoemaker <roland@golang.org>
Auto-Submit: Roland Shoemaker <roland@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
src/encoding/gob/doc.go

index 306d395d5bc75619e45e260f15beb837fe773e5d..04cb0ac471ea65d41d2214696cabd67a3a17bc9d 100644 (file)
@@ -276,6 +276,13 @@ document for background: https://golang.org/doc/go1compat
 
 See "Gobs of data" for a design discussion of the gob wire format:
 https://blog.golang.org/gobs-of-data
+
+# Security
+
+This package is not designed to be hardened against adversarial inputs. In
+particular, the Decoder does only basic sanity checking on decoded input sizes,
+and its limits are not configurable. Care should be taken when decoding gob data
+from untrusted sources, which may consume significant resources.
 */
 package gob