CVE-2025-4565: Protobuf Denial of Service Vulnerability
HIGHCVE-2025-4565 is a HIGH denial of service vulnerability (CWE-674: Uncontrolled Recursion) affecting Protobuf libraries in the PyPI ecosystem. The issue involves protobuf-python has a potential denial of service issue. Remediation is available by upgrading affected packages to version 4.25.8, 5.29.5, 6.31.1.
CVE-2025-4565 at a Glance
How to Fix CVE-2025-4565
To remediate this vulnerability, upgrade all affected 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.
pip install protobuf>=4.25.8
pip install protobuf>=5.29.5
pip install protobuf>=6.31.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show protobuf
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2025-4565, inspect your installed packages using pip:
pip show protobuf
Analyze the terminal output to locate any version of Protobuf in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.25.8), your application is affected.
Note: The pip show protobuf command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-674: Uncontrolled Recursion, where the product does not properly control the amount of recursion that takes place, consuming excessive resources, such as allocated memory or the program stack. In 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
CVE-2025-4565 Affected Protobuf Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
protobuf
|
PyPI |
< 4.25.8
|
4.25.8
|
|
protobuf
|
PyPI |
≥ 5.26.0rc1
< 5.29.5
|
5.29.5
|
|
protobuf
|
PyPI |
≥ 6.30.0rc1
< 6.31.1
|
6.31.1
|
References
Frequently Asked Questions
What is CVE-2025-4565?
Which Protobuf versions are affected?
What version fixes CVE-2025-4565?
Is protobuf affected?
What CWE is associated with CVE-2025-4565?
How can I check PyPI dependencies for CVE-2025-4565?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8qvm-5x2c-j2w7",
"modified" : "2025-06-16T16:02:58Z",
"published" : "2025-06-16T16:02:58Z",
"aliases" : [ "CVE-2025-4565" ],
"summary" : "protobuf-python has a potential Denial of Service issue",
"details" : "### Summary\nAny project that uses Protobuf pure-Python backend to parse untrusted Protocol Buffers data containing an arbitrary number of **recursive groups**, **recursive messages** or **a series of [`SGROUP`](https://protobuf.dev/programming-guides/encoding/#groups) tags** can be corrupted by exceeding the Python recursion limit.\n\nReporter: Alexis Challande, Trail of Bits Ecosystem Security Team\n[ecosystem@trailofbits.com](mailto:ecosystem@trailofbits.com)\n\nAffected versions: This issue only affects the [pure-Python implementation](https://github.com/protocolbuffers/protobuf/tree/main/python#implementation-backends) of protobuf-python backend. This is the implementation when `PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python` environment variable is set or the default when protobuf is used from Bazel or pure-Python PyPi wheels. CPython PyPi wheels do not use pure-Python by default.\n\nThis is a Python variant of a [previous issue affecting protobuf-java](https://github.com/protocolbuffers/protobuf/security/advisories/GHSA-735f-pc8j-v9w8).\n\n### Severity\nThis is a potential Denial of Service. Parsing nested protobuf data creates unbounded recursions that can be abused by an attacker.\n\n### Proof of Concept\nFor reproduction details, please refer to the unit tests [decoder_test.py](https://github.com/protocolbuffers/protobuf/blob/main/python/google/protobuf/internal/decoder_test.py#L87-L98) and [message_test](https://github.com/protocolbuffers/protobuf/blob/main/python/google/protobuf/internal/message_test.py#L1436-L1478)\n\n### Remediation and Mitigation\nA mitigation is available now. Please update to the latest available versions of the following packages:\n* protobuf-python(4.25.8, 5.29.5, 6.31.1)",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "protobuf"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.25.8"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "protobuf"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "5.26.0rc1"
}, {
"fixed" : "5.29.5"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "protobuf"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.30.0rc1"
}, {
"fixed" : "6.31.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/protocolbuffers/protobuf/security/advisories/GHSA-735f-pc8j-v9w8"
}, {
"type" : "WEB",
"url" : "https://github.com/protocolbuffers/protobuf/security/advisories/GHSA-8qvm-5x2c-j2w7"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-4565"
}, {
"type" : "WEB",
"url" : "https://github.com/protocolbuffers/protobuf/commit/17838beda2943d08b8a9d4df5b68f5f04f26d901"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/protocolbuffers/protobuf"
}, {
"type" : "WEB",
"url" : "https://github.com/protocolbuffers/protobuf/blob/main/python/google/protobuf/internal/decoder_test.py#L87-L98"
}, {
"type" : "WEB",
"url" : "https://github.com/protocolbuffers/protobuf/blob/main/python/google/protobuf/internal/message_test.py#L1436-L1478"
}, {
"type" : "WEB",
"url" : "https://github.com/protocolbuffers/protobuf/tree/main/python#implementation-backends"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-674" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2025-06-16T16:02:58Z",
"nvd_published_at" : "2025-06-16T15:15:24Z"
}
}