CVE-2024-24786: Golang protojson.Unmarshal function infinite loop when unmarshaling certain forms of invalid JSON
The protojson.Unmarshal function can enter an infinite loop when unmarshaling certain forms of invalid JSON. This condition can occur when unmarshaling into a message which contains a google.protobuf.Any value, or when the UnmarshalOptions.DiscardUnknown option is set.
Published Mar 6, 2024 · Updated Nov 7, 2024
Affected packages
google.golang.org/protobuf
- Ecosystem
- Go
- Affected
- < 1.33.0
- Fixed in
- 1.33.0
- Check
go list -m google.golang.org/protobuf
google.golang.org/protobuf/encoding/protojson
- Ecosystem
- Go
- Affected
- < 1.33.0
- Fixed in
- 1.33.0
- Check
go list -m google.golang.org/protobuf/encoding/protojson
google.golang.org/protobuf/internal/encoding/json
- Ecosystem
- Go
- Affected
- < 1.33.0
- Fixed in
- 1.33.0
- Check
go list -m google.golang.org/protobuf/internal/encoding/json
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
The protojson.Unmarshal function can enter an infinite loop when unmarshaling certain forms of invalid JSON. This condition can occur when unmarshaling into a message which contains a google.protobuf.Any value, or when the UnmarshalOptions.DiscardUnknown option is set.
Credited to oscerd, chancez.
References
- https://nvd.nist.gov/vuln/detail/CVE-2024-24786
- https://go.dev/cl/569356
- https://pkg.go.dev/vuln/GO-2024-2611
- https://github.com/protocolbuffers/protobuf-go/commit/f01a588e5810b90996452eec4a28f22a0afae023
- https://github.com/protocolbuffers/protobuf-go/releases/tag/v1.33.0
- https://lists.fedoraproject.org/archives/list/[email protected]/message/JDMBHAVSDU2FBDZ45U3A2VLSM35OJ2HU
- https://security.netapp.com/advisory/ntap-20240517-0002
- https://github.com/advisories/GHSA-8r3f-844c-mc37
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
