Vulnerabilities in pkg:golang/google.golang.org/protobuf
PACKAGECVE-2024-24786 is a MODERATE (CVSS 7.5) golang protojson.unmarshal function infinite loop vulnerability (CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')) affecting Google.golang.org/protobuf libraries in the Go ecosystem. The issue involves golang protojson.unmarshal function infinite loop when unmarshaling certain forms of invalid json. Remediation is available by upgrading affected packages to version 1.33.0.
pkg:golang/google.golang.org/protobuf
Vulnerability advisories affecting package pkg:golang/google.golang.org/protobuf. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-8r3f-844c-mc37 | CVE-2024-24786 | MODERATE | Golang protojson.Unmarshal function infinite loop when unmarshaling certain forms of invalid JSON |
| GHSA-hw7c-3rfg-p46j | CVE-2023-24535 | HIGH | google.golang.org/protobuf vulnerable to panic leading to denial of service |
CVE-2024-24786 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2024-24786
To remediate this vulnerability, upgrade all affected Google.golang.org/protobuf dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade google.golang.org/protobuf to 1.33.0
Upgrade google.golang.org/protobuf/encoding/protojson to 1.33.0
Upgrade google.golang.org/protobuf/internal/encoding/json to 1.33.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for google.golang.org/protobuf
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-24786, inspect your project dependencies for Google.golang.org/protobuf:
inspect dependencies for google.golang.org/protobuf
Analyze the terminal output to locate any version of Google.golang.org/protobuf in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.33.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop'), where the product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop. In Google.golang.org/protobuf, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-24786 Affected Google.golang.org/protobuf Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
google.golang.org/protobuf
|
Go |
< 1.33.0
|
1.33.0
|
|
google.golang.org/protobuf/encoding/protojson
|
Go |
< 1.33.0
|
1.33.0
|
|
google.golang.org/protobuf/internal/encoding/json
|
Go |
< 1.33.0
|
1.33.0
|
References
Frequently Asked Questions
What is CVE-2024-24786?
Which Google.golang.org/protobuf versions are affected?
What version fixes CVE-2024-24786?
Is google.golang.org/protobuf affected?
Is google.golang.org/protobuf/encoding/protojson affected?
What is the CVSS score of CVE-2024-24786?
What CWE is associated with CVE-2024-24786?
How can I check Go dependencies for CVE-2024-24786?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8r3f-844c-mc37",
"modified" : "2024-11-07T19:19:40Z",
"published" : "2024-03-06T00:31:27Z",
"aliases" : [ "CVE-2024-24786" ],
"summary" : "Golang protojson.Unmarshal function infinite loop when unmarshaling certain forms of invalid JSON",
"details" : "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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:U"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "google.golang.org/protobuf"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.33.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "google.golang.org/protobuf/encoding/protojson"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.33.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "google.golang.org/protobuf/internal/encoding/json"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.33.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-24786"
}, {
"type" : "WEB",
"url" : "https://github.com/protocolbuffers/protobuf-go/commit/f01a588e5810b90996452eec4a28f22a0afae023"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/protocolbuffers/protobuf-go"
}, {
"type" : "WEB",
"url" : "https://github.com/protocolbuffers/protobuf-go/releases/tag/v1.33.0"
}, {
"type" : "WEB",
"url" : "https://go.dev/cl/569356"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/JDMBHAVSDU2FBDZ45U3A2VLSM35OJ2HU"
}, {
"type" : "WEB",
"url" : "https://pkg.go.dev/vuln/GO-2024-2611"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20240517-0002"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2024/03/08/4"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-835" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-03-13T21:01:28Z",
"nvd_published_at" : "2024-03-05T23:15:07Z"
}
}