MediumGHSA-h4h5-3hr4-j3g2CVE-2022-3171

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?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

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
Update to the fixed version for your release line, for example: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
Update to the fixed version for your release line, for example: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
Update to the fixed version for your release line, for example:bundle update --conservative google-protobuf # Gemfile: '>= 3.21.7'
Affected
>=3.21.0-rc-1 <3.21.7
Fixed in
3.21.7
Update to the fixed version for your release line, for example: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
Update to the fixed version for your release line, for example: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
Update to the fixed version for your release line, for example: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
Update to the fixed version for your release line, for example: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
Update to the fixed version for your release line, for example: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
Update to the fixed version for your release line, for example: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
Update to the fixed version for your release line, for example: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
Update to the fixed version for your release line, for example: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
Update to the fixed version for your release line, for example:bundle update --conservative google-protobuf # Gemfile: '>= 3.20.3'
Affected
>=3.17.0.rc.1 <3.19.6
Fixed in
3.19.6
Update to the fixed version for your release line, for example:bundle update --conservative google-protobuf # Gemfile: '>= 3.19.6'
Affected
<3.16.3
Fixed in
3.16.3
Update to the fixed version for your release line, for example:bundle update --conservative google-protobuf # Gemfile: '>= 3.16.3'
Affected
>=3.20.0-rc-1 <3.20.3
Fixed in
3.20.3
Update to the fixed version for your release line, for example: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
Update to the fixed version for your release line, for example: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
Update to the fixed version for your release line, for example: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
Update to the fixed version for your release line, for example: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
Update to the fixed version for your release line, for example: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
Update to the fixed version for your release line, for example:mvn versions:use-dep-version -Dincludes=com.google.protobuf:protobuf-kotlin-lite -DdepVersion=3.16.3 -DforceVersion=true

Details

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
com.google.protobuf:protobuf-java security overview

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.