CVE-2023-32731: Grpc protobuf Connection Confusion Vulnerability

HIGH
Advisory Identifier: GHSA-cfgp-2977-2fmm
CVSS 7.4
CWE-440
Published
Advisory Summary

CVE-2023-32731 is a HIGH (CVSS 7.4) connection confusion vulnerability (CWE-440: Expected Behavior Violation) affecting Grpc protobuf libraries in the Maven ecosystem. The issue involves connection confusion in grpc. Remediation is available by upgrading affected packages to version 1.53.1, 1.54.2.

CVE-2023-32731 at a Glance

CVE Identifier CVE-2023-32731
GHSA Identifier GHSA-cfgp-2977-2fmm
Severity HIGH
CVSS v3.1 Base Score 7.4
CWE Classification CWE-440: Expected Behavior Violation
Affected Product Grpc protobuf
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 7.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2023-32731

To remediate this vulnerability, upgrade all affected Grpc 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.

io.grpc:grpc-protobuf fixed: 1.53.1
<dependency>
    <groupId>io.grpc</groupId>
    <artifactId>grpc-protobuf</artifactId>
    <version>1.53.1</version>
</dependency>
grpcio fixed: 1.53.1
pip install grpcio>=1.53.1
grpc fixed: 1.53.1
Upgrade grpc to 1.53.1
grpcio fixed: 1.54.2
pip install grpcio>=1.54.2
grpc fixed: 1.54.2
Upgrade grpc to 1.54.2
io.grpc:grpc-protobuf fixed: 1.54.2
<dependency>
    <groupId>io.grpc</groupId>
    <artifactId>grpc-protobuf</artifactId>
    <version>1.54.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=io.grpc

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2023-32731, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=io.grpc

Analyze the terminal output to locate any version of Grpc protobuf in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.53.1), your application is affected.

Note: The mvn dependency:tree -Dincludes=io.grpc 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-440: Expected Behavior Violation, where a feature, api, or function does not perform according to its specification. In Grpc 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

When gRPC HTTP2 stack raised a header size exceeded error, it skipped parsing the rest of the HPACK frame. This caused any HPACK table mutations to also be skipped, resulting in a desynchronization of HPACK tables between sender and receiver. If leveraged, say, between a proxy and a backend, this could lead to requests from the proxy being interpreted as containing headers from different proxy clients - leading to an information leak that can be used for privilege escalation or data exfiltration.

CVE-2023-32731 Affected Grpc protobuf Versions

6 component(s)
Fixed Versions:
1.53.11.54.2
Product / Package Ecosystem Affected Versions Fixed Version
io.grpc:grpc-protobuf
Maven
≥ 1.53.0
< 1.53.1
1.53.1
grpcio
PyPI
≥ 1.53.0
< 1.53.1
1.53.1
grpc
RubyGems
≥ 1.53.0
< 1.53.1
1.53.1
grpcio
PyPI
≥ 1.54.0
< 1.54.2
1.54.2
grpc
RubyGems
≥ 1.54.0
< 1.54.2
1.54.2
io.grpc:grpc-protobuf
Maven
≥ 1.54.0
< 1.54.2
1.54.2

References

Frequently Asked Questions

What is CVE-2023-32731?
CVE-2023-32731 is a security vulnerability in Grpc protobuf involving Connection confusion in gRPC under CWE-440: Expected Behavior Violation.
Which Grpc protobuf versions are affected?
Affected versions include releases prior to 1.53.1, 1.54.2 across affected packages: io.grpc:grpc-protobuf, grpcio, grpc.
What version fixes CVE-2023-32731?
Upgrading to 1.53.1, 1.54.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is grpc-protobuf affected?
Yes, io.grpc:grpc-protobuf is affected in releases prior to 1.53.1, 1.54.2. Upgrade your dependency to 1.53.1, 1.54.2 or later.
Is grpcio affected?
Yes, grpcio is affected in releases prior to 1.53.1, 1.54.2. Upgrade your dependency to 1.53.1, 1.54.2 or later.
What is the CVSS score of CVE-2023-32731?
CVE-2023-32731 has a CVSS v3.1 base score of 7.4 (HIGH) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:H.
What CWE is associated with CVE-2023-32731?
CVE-2023-32731 is classified under CWE-440: Expected Behavior Violation (A feature, API, or function does not perform according to its specification.).
How can I check Maven dependencies for CVE-2023-32731?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=io.grpc'. 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-cfgp-2977-2fmm",
  "modified" : "2025-08-13T14:56:11Z",
  "published" : "2023-07-05T19:12:51Z",
  "aliases" : [ "CVE-2023-32731" ],
  "summary" : "Connection confusion in gRPC",
  "details" : "When gRPC HTTP2 stack raised a header size exceeded error, it skipped parsing the rest of the HPACK frame. This caused any HPACK table mutations to also be skipped, resulting in a desynchronization of HPACK tables between sender and receiver. If leveraged, say, between a proxy and a backend, this could lead to requests from the proxy being interpreted as containing headers from different proxy clients - leading to an information leak that can be used for privilege escalation or data exfiltration.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.grpc:grpc-protobuf"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.53.0"
      }, {
        "fixed" : "1.53.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "grpcio"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.53.0"
      }, {
        "fixed" : "1.53.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "grpc"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.53.0"
      }, {
        "fixed" : "1.53.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "grpcio"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.54.0"
      }, {
        "fixed" : "1.54.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "grpc"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.54.0"
      }, {
        "fixed" : "1.54.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.grpc:grpc-protobuf"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.54.0"
      }, {
        "fixed" : "1.54.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-32731"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/grpc/grpc/issues/33463"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/grpc/grpc/pull/32309"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/grpc/grpc/pull/33005"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/grpc/grpc/commit/29d8beee0ac2555773b2a2dda5601c74a95d6c10"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/grpc/grpc/commit/65a2a895afaf1d2072447b9baf246374b182a946"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/grpc/grpc/releases/tag/v1.53.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/grpc/grpc/releases/tag/v1.54.2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/grpc/CVE-2023-32731.yml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-440" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-05T20:26:48Z",
    "nvd_published_at" : "2023-06-09T11:15:09Z"
  }
}