CVE-2021-22569: Protobuf java Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-wrvw-hg22-4m67
CVSS 7.5
CWE-696
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2021-22569
GHSA Identifier GHSA-wrvw-hg22-4m67
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-696: Incorrect Behavior Order
Affected Product Protobuf java
Package Ecosystem Maven
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (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.

com.google.protobuf:protobuf-java fixed: 3.16.1
<dependency>
    <groupId>com.google.protobuf</groupId>
    <artifactId>protobuf-java</artifactId>
    <version>3.16.1</version>
</dependency>
google-protobuf fixed: 3.19.2
Upgrade google-protobuf to 3.19.2
com.google.protobuf:protobuf-java fixed: 3.18.2
<dependency>
    <groupId>com.google.protobuf</groupId>
    <artifactId>protobuf-java</artifactId>
    <version>3.18.2</version>
</dependency>
com.google.protobuf:protobuf-java fixed: 3.19.2
<dependency>
    <groupId>com.google.protobuf</groupId>
    <artifactId>protobuf-java</artifactId>
    <version>3.19.2</version>
</dependency>
com.google.protobuf:protobuf-kotlin fixed: 3.18.2
<dependency>
    <groupId>com.google.protobuf</groupId>
    <artifactId>protobuf-kotlin</artifactId>
    <version>3.18.2</version>
</dependency>
com.google.protobuf:protobuf-kotlin fixed: 3.19.2
<dependency>
    <groupId>com.google.protobuf</groupId>
    <artifactId>protobuf-kotlin</artifactId>
    <version>3.19.2</version>
</dependency>
Verify Direct and Transitive Dependencies

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

## Summary A potential Denial of Service issue in protobuf-java was discovered in the parsing procedure for binary data. Reporter: [OSS-Fuzz](https://github.com/google/oss-fuzz) Affected versions: All versions of Java Protobufs (including Kotlin and JRuby) prior to the versions listed below. Protobuf "javalite" users (typically Android) are not affected. ## Severity [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. ## Proof of Concept For reproduction details, please refer to the oss-fuzz issue that identifies the specific inputs that exercise this parsing weakness. ## Remediation and Mitigation Please update to the latest available versions of the following packages: - protobuf-java (3.16.1, 3.18.2, 3.19.2) - protobuf-kotlin (3.18.2, 3.19.2) - google-protobuf [JRuby gem only] (3.19.2)

CVE-2021-22569 Affected Protobuf java Versions

6 component(s)
Fixed Versions:
3.16.13.19.23.18.2
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?
CVE-2021-22569 is a security vulnerability in Protobuf java involving A potential Denial of Service issue in protobuf-java under CWE-696: Incorrect Behavior Order.
Which Protobuf java versions are affected?
Affected versions include releases prior to 3.16.1, 3.19.2, 3.18.2 across affected packages: com.google.protobuf:protobuf-java, google-protobuf, com.google.protobuf:protobuf-kotlin.
What version fixes CVE-2021-22569?
Upgrading to 3.16.1, 3.19.2, 3.18.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is protobuf-java affected?
Yes, com.google.protobuf:protobuf-java is affected in releases prior to 3.16.1, 3.18.2, 3.19.2. Upgrade your dependency to 3.16.1, 3.18.2, 3.19.2 or later.
Is google-protobuf affected?
Yes, google-protobuf is affected in releases prior to 3.19.2. Upgrade your dependency to 3.19.2 or later.
What is the CVSS score of CVE-2021-22569?
CVE-2021-22569 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2021-22569?
CVE-2021-22569 is classified under CWE-696: Incorrect Behavior Order (The product performs multiple related behaviors, but the behaviors are performed in the wrong order in ways that may produce resultant weaknesses.).
How can I check Maven dependencies for CVE-2021-22569?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=com.google.protobuf'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}