protobuf-java has a potential Denial of Service issue
Published 4 Oct 2022 · Updated 10 Sept 2026
Is your project on an affected com.google.protobuf:protobuf-java?
Look after several Java apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected packages
- Affected
- >=3.21.0-rc-1 <3.21.7
- Fixed in
- 3.21.7
mvn versions:use-dep-version -Dincludes=com.google.protobuf:protobuf-java -DdepVersion=3.21.7 -DforceVersion=true- Affected
- >=3.21.0-rc-1 <3.21.7
- Fixed in
- 3.21.7
mvn versions:use-dep-version -Dincludes=com.google.protobuf:protobuf-kotlin -DdepVersion=3.21.7 -DforceVersion=true- Affected
- >=3.21.0.rc.1 <3.21.7
- Fixed in
- 3.21.7
bundle update --conservative google-protobuf # Gemfile: '>= 3.21.7'- Affected
- >=3.21.0-rc-1 <3.21.7
- Fixed in
- 3.21.7
mvn versions:use-dep-version -Dincludes=com.google.protobuf:protobuf-javalite -DdepVersion=3.21.7 -DforceVersion=true- Affected
- >=3.21.0-rc-1 <3.21.7
- Fixed in
- 3.21.7
mvn versions:use-dep-version -Dincludes=com.google.protobuf:protobuf-kotlin-lite -DdepVersion=3.21.7 -DforceVersion=true- Affected
- >=3.20.0-rc-1 <3.20.3
- Fixed in
- 3.20.3
mvn versions:use-dep-version -Dincludes=com.google.protobuf:protobuf-java -DdepVersion=3.20.3 -DforceVersion=true- Affected
- >=3.17.0-rc-1 <3.19.6
- Fixed in
- 3.19.6
mvn versions:use-dep-version -Dincludes=com.google.protobuf:protobuf-java -DdepVersion=3.19.6 -DforceVersion=true- Affected
- <3.16.3
- Fixed in
- 3.16.3
mvn versions:use-dep-version -Dincludes=com.google.protobuf:protobuf-java -DdepVersion=3.16.3 -DforceVersion=true- Affected
- >=3.20.0-rc-1 <3.20.3
- Fixed in
- 3.20.3
mvn versions:use-dep-version -Dincludes=com.google.protobuf:protobuf-kotlin -DdepVersion=3.20.3 -DforceVersion=true- Affected
- >=3.17.0-rc-1 <3.19.6
- Fixed in
- 3.19.6
mvn versions:use-dep-version -Dincludes=com.google.protobuf:protobuf-kotlin -DdepVersion=3.19.6 -DforceVersion=true- Affected
- <3.16.3
- Fixed in
- 3.16.3
mvn versions:use-dep-version -Dincludes=com.google.protobuf:protobuf-kotlin -DdepVersion=3.16.3 -DforceVersion=true- Affected
- >=3.20.0.rc.1 <3.20.3
- Fixed in
- 3.20.3
bundle update --conservative google-protobuf # Gemfile: '>= 3.20.3'- Affected
- >=3.17.0.rc.1 <3.19.6
- Fixed in
- 3.19.6
bundle update --conservative google-protobuf # Gemfile: '>= 3.19.6'- Affected
- <3.16.3
- Fixed in
- 3.16.3
bundle update --conservative google-protobuf # Gemfile: '>= 3.16.3'- Affected
- >=3.20.0-rc-1 <3.20.3
- Fixed in
- 3.20.3
mvn versions:use-dep-version -Dincludes=com.google.protobuf:protobuf-javalite -DdepVersion=3.20.3 -DforceVersion=true- Affected
- >=3.17.0-rc-1 <3.19.6
- Fixed in
- 3.19.6
mvn versions:use-dep-version -Dincludes=com.google.protobuf:protobuf-javalite -DdepVersion=3.19.6 -DforceVersion=true- Affected
- <3.16.3
- Fixed in
- 3.16.3
mvn versions:use-dep-version -Dincludes=com.google.protobuf:protobuf-javalite -DdepVersion=3.16.3 -DforceVersion=true- Affected
- >=3.20.0-rc-1 <3.20.3
- Fixed in
- 3.20.3
mvn versions:use-dep-version -Dincludes=com.google.protobuf:protobuf-kotlin-lite -DdepVersion=3.20.3 -DforceVersion=true- Affected
- >=3.17.0-rc-1 <3.19.6
- Fixed in
- 3.19.6
mvn versions:use-dep-version -Dincludes=com.google.protobuf:protobuf-kotlin-lite -DdepVersion=3.19.6 -DforceVersion=true- Affected
- <3.16.3
- Fixed in
- 3.16.3
mvn versions:use-dep-version -Dincludes=com.google.protobuf:protobuf-kotlin-lite -DdepVersion=3.16.3 -DforceVersion=trueDetails
Summary
A potential Denial of Service issue in protobuf-java core and lite was discovered in the parsing procedure for binary and text format data. Input streams containing multiple instances of non-repeated embedded messages with repeated or unknown fields causes objects to be converted back-n-forth between mutable and immutable forms, resulting in potentially long garbage collection pauses.
Reporter: OSS Fuzz
Affected versions: This issue affects both the Java full and lite Protobuf runtimes, as well as Protobuf for Kotlin and JRuby, which themselves use the Java Protobuf runtime.
Severity
CVE-2022-3171 Medium - CVSS Score: 5.7 (NOTE: there may be a delay in publication)
Remediation and Mitigation
Please update to the latest available versions of the following packages:
protobuf-java (3.21.7, 3.20.3, 3.19.6, 3.16.3) protobuf-javalite (3.21.7, 3.20.3, 3.19.6, 3.16.3) protobuf-kotlin (3.21.7, 3.20.3, 3.19.6, 3.16.3) protobuf-kotlin-lite (3.21.7, 3.20.3, 3.19.6, 3.16.3) google-protobuf [JRuby gem only] (3.21.7, 3.20.3, 3.19.6)
Is GHSA-h4h5-3hr4-j3g2 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected com.google.protobuf:protobuf-java, and gives you the command that fixes it.
More advisories for com.google.protobuf:protobuf-java
- HighCVE-2024-7254protobuf-java has potential Denial of Service issue · 19 Sept 2024
- HighCVE-2022-3510Protobuf Java vulnerable to Uncontrolled Resource Consumption · 12 Dec 2022
- HighCVE-2022-3509Protobuf Java vulnerable to Uncontrolled Resource Consumption · 12 Dec 2022
- HighCVE-2021-22569A potential Denial of Service issue in protobuf-java · 7 Jan 2022
References
- Linkgithub.com/protocolbuffers/protobuf/security/advisories/GHSA-h4h5-3hr4-j3g2
- Advisorynvd.nist.gov/vuln/detail/CVE-2022-3171
- Linkbugs.chromium.org/p/oss-fuzz/issues/detail?id=48771
- Packagegithub.com/protocolbuffers/protobuf
- Linkgithub.com/protocolbuffers/protobuf/releases/tag/v21.7
- Linkgithub.com/protocolbuffers/protobuf/releases/tag/v3.16.3
- Linkgithub.com/protocolbuffers/protobuf/releases/tag/v3.19.6
- Linkgithub.com/protocolbuffers/protobuf/releases/tag/v3.20.3
- Linkgithub.com/rubysec/ruby-advisory-db/blob/master/gems/google-protobuf/CVE-2022-3171.yml
- Linklists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/CBAUKJQL6O4TIWYBENORSY5P43TVB4M3
- Linklists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/MPCGUT3T5L6C3IDWUPSUO22QDCGQKTOP
- Linksecurity.gentoo.org/glsa/202301-09
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.