Acknowledgement
Description
Bucket.Stats() in go.etcd.io/bbolt panics with an index out-of-range
when encountering a branch page with zero elements. At line 664 of
bucket.go, p.BranchPageElement(p.Count() - 1) is called without
checking if Count() != 0. When a branch page has zero elements
(e.g., due to database corruption or partial writes), the index
underflows causing an unrecoverable panic.
This is a public API that does not return an error, so callers have
no way to handle the failure. Any process calling Stats() on a
corrupted bucket crashes entirely. This affects downstream users
such as etcd, Kubernetes components, and Consul.
CWE: CWE-125 (Out-of-bounds Read)
Fix PRs:
Maintainer confirmed: 2026-03-30
Fix merged: All PRs merged (main + backports to 1.4 and 1.3)
Issue: etcd-io/bbolt#1170
Affected Modules, Packages, Versions and Symbols
Module: go.etcd.io/bbolt
Package: go.etcd.io/bbolt
Symbol: Bucket.Stats
Versions: all versions before fix (introduced: 0, fixed: see merged PRs #1171, #1172, #1173)
CVE/GHSA ID
No response
Fix Commit or Pull Request
etcd-io/bbolt#1171
References
etcd-io/bbolt#1170
etcd-io/bbolt#1170 (comment)
etcd-io/bbolt#1171
etcd-io/bbolt#1172
etcd-io/bbolt#1173
Additional information
No response
Acknowledgement
Description
Bucket.Stats()in go.etcd.io/bbolt panics with an index out-of-rangewhen encountering a branch page with zero elements. At line 664 of
bucket.go,
p.BranchPageElement(p.Count() - 1)is called withoutchecking if
Count() != 0. When a branch page has zero elements(e.g., due to database corruption or partial writes), the index
underflows causing an unrecoverable panic.
This is a public API that does not return an error, so callers have
no way to handle the failure. Any process calling Stats() on a
corrupted bucket crashes entirely. This affects downstream users
such as etcd, Kubernetes components, and Consul.
CWE: CWE-125 (Out-of-bounds Read)
Fix PRs:
Maintainer confirmed: 2026-03-30
Fix merged: All PRs merged (main + backports to 1.4 and 1.3)
Issue: etcd-io/bbolt#1170
Affected Modules, Packages, Versions and Symbols
Module: go.etcd.io/bbolt Package: go.etcd.io/bbolt Symbol: Bucket.Stats Versions: all versions before fix (introduced: 0, fixed: see merged PRs #1171, #1172, #1173)CVE/GHSA ID
No response
Fix Commit or Pull Request
etcd-io/bbolt#1171
References
etcd-io/bbolt#1170
etcd-io/bbolt#1170 (comment)
etcd-io/bbolt#1171
etcd-io/bbolt#1172
etcd-io/bbolt#1173
Additional information
No response