CVE-2021-22569: Protobuf java Denial of Service Vulnerability
HIGHCVE-2021-22569 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-696: Incorrect Behavior Order) affecting Protobuf java libraries in the Maven ecosystem. The issue involves a potential denial of service issue in protobuf-java. Remediation is available by upgrading affected packages to version 3.16.1, 3.19.2, 3.18.2.
CVE-2021-22569 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-2021-22569
To remediate this vulnerability, upgrade all affected Protobuf java dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.16.1</version>
</dependency>
Upgrade google-protobuf to 3.19.2
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.18.2</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.19.2</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-kotlin</artifactId>
<version>3.18.2</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-kotlin</artifactId>
<version>3.19.2</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=com.google.protobuf
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2021-22569, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=com.google.protobuf
Analyze the terminal output to locate any version of Protobuf java in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.16.1), your application is affected.
Note: The mvn dependency:tree -Dincludes=com.google.protobuf command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-696: Incorrect Behavior Order, where the product performs multiple related behaviors, but the behaviors are performed in the wrong order in ways that may produce resultant weaknesses. In Protobuf java, 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-2021-22569 Affected Protobuf java Versions
6 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
com.google.protobuf:protobuf-java
|
Maven |
< 3.16.1
|
3.16.1
|
|
google-protobuf
|
RubyGems |
< 3.19.2
|
3.19.2
|
|
com.google.protobuf:protobuf-java
|
Maven |
≥ 3.18.0
< 3.18.2
|
3.18.2
|
|
com.google.protobuf:protobuf-java
|
Maven |
≥ 3.19.0
< 3.19.2
|
3.19.2
|
|
com.google.protobuf:protobuf-kotlin
|
Maven |
≥ 3.18.0
< 3.18.2
|
3.18.2
|
|
com.google.protobuf:protobuf-kotlin
|
Maven |
≥ 3.19.0
< 3.19.2
|
3.19.2
|
References
Frequently Asked Questions
What is CVE-2021-22569?
Which Protobuf java versions are affected?
What version fixes CVE-2021-22569?
Is protobuf-java affected?
Is google-protobuf affected?
What is the CVSS score of CVE-2021-22569?
What CWE is associated with CVE-2021-22569?
How can I check Maven dependencies for CVE-2021-22569?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-wrvw-hg22-4m67",
"modified" : "2023-01-24T15:45:26Z",
"published" : "2022-01-07T22:31:44Z",
"aliases" : [ "CVE-2021-22569" ],
"summary" : "A potential Denial of Service issue in protobuf-java",
"details" : "## Summary\n\nA potential Denial of Service issue in protobuf-java was discovered in the parsing procedure for binary data.\n\nReporter: [OSS-Fuzz](https://github.com/google/oss-fuzz)\n\nAffected versions: All versions of Java Protobufs (including Kotlin and JRuby) prior to the versions listed below. Protobuf \"javalite\" users (typically Android) are not affected.\n\n## Severity\n\n[CVE-2021-22569](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22569) **High** - CVSS Score: 7.5, An implementation weakness in how unknown fields are parsed in Java. A small (~800 KB) malicious payload can occupy the parser for several minutes by creating large numbers of short-lived objects that cause frequent, repeated GC pauses.\n\n## Proof of Concept\n\nFor reproduction details, please refer to the oss-fuzz issue that identifies the specific inputs that exercise this parsing weakness.\n\n## Remediation and Mitigation\n\nPlease update to the latest available versions of the following packages:\n\n- protobuf-java (3.16.1, 3.18.2, 3.19.2) \n- protobuf-kotlin (3.18.2, 3.19.2)\n- google-protobuf [JRuby gem only] (3.19.2) \n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "com.google.protobuf:protobuf-java"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.16.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "RubyGems",
"name" : "google-protobuf"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.19.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "com.google.protobuf:protobuf-java"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.18.0"
}, {
"fixed" : "3.18.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "com.google.protobuf:protobuf-java"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.19.0"
}, {
"fixed" : "3.19.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "com.google.protobuf:protobuf-kotlin"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.18.0"
}, {
"fixed" : "3.18.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "com.google.protobuf:protobuf-kotlin"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.19.0"
}, {
"fixed" : "3.19.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/protocolbuffers/protobuf/security/advisories/GHSA-wrvw-hg22-4m67"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-22569"
}, {
"type" : "WEB",
"url" : "https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39330"
}, {
"type" : "WEB",
"url" : "https://cloud.google.com/support/bulletins#gcp-2022-001"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/protocolbuffers/protobuf"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpuapr2022.html"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2022/01/12/4"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2022/01/12/7"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-696" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-01-07T22:23:14Z",
"nvd_published_at" : "2022-01-10T14:10:00Z"
}
}