CVE-2023-33953: Grpcio Excessive Iteration Vulnerability
HIGHCVE-2023-33953 is a HIGH (CVSS 7.5) excessive iteration vulnerability (CWE-789: Memory Allocation with Excessive Size Value) affecting Grpcio libraries in the PyPI ecosystem. The issue involves excessive iteration in grpc. Remediation is available by upgrading affected packages to version 1.53.2, 1.54.3, 1.55.2, 1.56.2.
CVE-2023-33953 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-2023-33953
To remediate this vulnerability, upgrade all affected Grpcio dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install grpcio>=1.53.2
pip install grpcio>=1.54.3
pip install grpcio>=1.55.2
pip install grpcio>=1.56.2
Upgrade grpc to 1.53.2
Upgrade grpc to 1.54.3
Upgrade grpc to 1.55.2
Upgrade grpc to 1.56.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show grpcio
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2023-33953, inspect your installed packages using pip:
pip show grpcio
Analyze the terminal output to locate any version of Grpcio in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.53.2), your application is affected.
Note: The pip show grpcio command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-789: Memory Allocation with Excessive Size Value, where the product allocates memory based on an untrusted, large size value, but it does not ensure that the size is within expected limits, allowing arbitrary amounts of memory to be allocated. In Grpcio, 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-2023-33953 Affected Grpcio Versions
8 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
grpcio
|
PyPI |
< 1.53.2
|
1.53.2
|
|
grpcio
|
PyPI |
≥ 1.54.0
< 1.54.3
|
1.54.3
|
|
grpcio
|
PyPI |
≥ 1.55.0
< 1.55.2
|
1.55.2
|
|
grpcio
|
PyPI |
≥ 1.56.0
< 1.56.2
|
1.56.2
|
|
grpc
|
RubyGems |
< 1.53.2
|
1.53.2
|
|
grpc
|
RubyGems |
≥ 1.54.0
< 1.54.3
|
1.54.3
|
|
grpc
|
RubyGems |
≥ 1.55.0
< 1.55.2
|
1.55.2
|
|
grpc
|
RubyGems |
≥ 1.56.0
< 1.56.2
|
1.56.2
|
References
Frequently Asked Questions
What is CVE-2023-33953?
Which Grpcio versions are affected?
What version fixes CVE-2023-33953?
Is grpcio affected?
Is grpc affected?
What is the CVSS score of CVE-2023-33953?
What CWE is associated with CVE-2023-33953?
How can I check PyPI dependencies for CVE-2023-33953?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-496j-2rq6-j6cc",
"modified" : "2024-07-30T21:37:50Z",
"published" : "2023-08-09T15:30:15Z",
"aliases" : [ "CVE-2023-33953" ],
"summary" : "Excessive Iteration in gRPC",
"details" : "gRPC contains a vulnerability that allows hpack table accounting errors could lead to unwanted disconnects between clients and servers in exceptional cases/ Three vectors were found that allow the following DOS attacks:\n\n- Unbounded memory buffering in the HPACK parser\n- Unbounded CPU consumption in the HPACK parser\n\nThe unbounded CPU consumption is down to a copy that occurred per-input-block in the parser, and because that could be unbounded due to the memory copy bug we end up with an O(n^2) parsing loop, with n selected by the client.\n\nThe unbounded memory buffering bugs:\n\n- The header size limit check was behind the string reading code, so we needed to first buffer up to a 4 gigabyte string before rejecting it as longer than 8 or 16kb.\n- HPACK varints have an encoding quirk whereby an infinite number of 0’s can be added at the start of an integer. gRPC’s hpack parser needed to read all of them before concluding a parse.\n- gRPC’s metadata overflow check was performed per frame, so that the following sequence of frames could cause infinite buffering: HEADERS: containing a: 1 CONTINUATION: containing a: 2 CONTINUATION: containing a: 3 etc…",
"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" : "PyPI",
"name" : "grpcio"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.53.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "grpcio"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.54.0"
}, {
"fixed" : "1.54.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "grpcio"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.55.0"
}, {
"fixed" : "1.55.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "grpcio"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.56.0"
}, {
"fixed" : "1.56.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "RubyGems",
"name" : "grpc"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.53.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "RubyGems",
"name" : "grpc"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.54.0"
}, {
"fixed" : "1.54.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "RubyGems",
"name" : "grpc"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.55.0"
}, {
"fixed" : "1.55.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "RubyGems",
"name" : "grpc"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.56.0"
}, {
"fixed" : "1.56.2"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-33953"
}, {
"type" : "WEB",
"url" : "https://cloud.google.com/support/bulletins#gcp-2023-022"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-496j-2rq6-j6cc"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/grpc/CVE-2023-33953.yml"
}, {
"type" : "WEB",
"url" : "https://security.snyk.io/vuln/SNYK-RUBY-GRPC-5834442"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-770", "CWE-789" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-07-30T10:26:43Z",
"nvd_published_at" : "2023-08-09T13:15:09Z"
}
}