]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.17] 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:20:37 +0000 (15:20 +0000)
commit8c1d8c836270615cfb5b229932269048ef59ac07
tree2137c8220879aa479bcf56198a297918265f7991
parent0117dee7dccbbd7803d88f65a2ce8bd686219ad3
[release-branch.go1.17] 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 #53719
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/+/417072
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
src/io/fs/glob.go
src/io/fs/glob_test.go