]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.18] io/fs: fix stack exhaustion in Glob
authorJulie Qiu <julieqiu@google.com>
Thu, 23 Jun 2022 23:17:53 +0000 (23:17 +0000)
committerMichael Knyszek <mknyszek@google.com>
Tue, 12 Jul 2022 15:06:37 +0000 (15:06 +0000)
commit315e80d293b684ac2902819e58f618f1b5a14d49
treebec1d6550886048953bc8950d785cd247ee33c75
parent8e27a8ac4c001c27713810b75925aa3794049c48
[release-branch.go1.18] io/fs: fix stack exhaustion in Glob

A limit is added to the number of path separators allowed by an input to
Glob, to prevent stack exhaustion issues.

Thanks to Juho Nurminen of Mattermost who reported a similar issue in
path/filepath.

Fixes #53720
Updates #53415
Fixes CVE-2022-30630

Change-Id: I5a9d02591fed90cd3d52627f5945f1301e53465d
Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1497588
Reviewed-by: Roland Shoemaker <bracewell@google.com>
(cherry picked from commit fdccc5d7bd0f276d0a8de3a818ca844f0bed5d97)
Reviewed-on: https://go-review.googlesource.com/c/go/+/417058
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
src/io/fs/glob.go
src/io/fs/glob_test.go