GHSA-8qvm-5x2c-j2w7 CVE-2025-4565 PYSEC-2026-1806
protobuf-python has a potential Denial of Service issue
- Severity
- 8.2 / 10
- High · CVSS 4.0
- Exploit chance (EPSS)
- 0.26%
- Chance of exploitation in the next 30 days. Higher than 17.16% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-674 Uncontrolled Recursion
- Fix
4.25.8- Upgrade protobuf to this version or later
Description
Summary
Any 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 tags can be corrupted by exceeding the Python recursion limit.
Reporter: Alexis Challande, Trail of Bits Ecosystem Security Team ecosystem@trailofbits.com
Affected versions: This issue only affects the pure-Python implementation 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.
This is a Python variant of a previous issue affecting protobuf-java.
Severity
This is a potential Denial of Service. Parsing nested protobuf data creates unbounded recursions that can be abused by an attacker.
Proof of Concept
For reproduction details, please refer to the unit tests decoder_test.py and message_test
Remediation and Mitigation
A mitigation is available now. Please update to the latest available versions of the following packages:
- protobuf-python(4.25.8, 5.29.5, 6.31.1)
Affected versions
PyPI
| Package | Vulnerable | Fixed in |
|---|---|---|
| protobuf | < 4.25.8 |
4.25.8 |
| protobuf | >= 5.26.0rc1, < 5.29.5 |
5.29.5 |
| protobuf | >= 6.30.0rc1, < 6.31.1 |
6.31.1 |
| protobuf | < 4.25.8 |
4.25.8 |
| protobuf | >= 5.26.0rc1, < 5.29.5 |
5.29.5 |
| protobuf | >= 6.30.0rc1, < 6.31.1 |
6.31.1 |
| protobuf | < 4.25.8>= 5.26.0rc1, < 5.29.5>= 6.30.0rc1, < 6.31.1 |
4.25.85.29.56.31.1 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
protobuf PyPI → 4.25.8
- pip
pip install --upgrade "protobuf>=4.25.8"- poetry
poetry add "protobuf>=4.25.8"- uv
uv add "protobuf>=4.25.8"
Severity breakdown
CVSS 4.0 8.2
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
- Attack vector
- Network
- Attack complexity
- Low
- Attack requirements
- Present
- Privileges required
- None
- User interaction
- None
- Confidentiality (vulnerable system)
- None
- Integrity (vulnerable system)
- None
- Availability (vulnerable system)
- High
- Confidentiality (subsequent systems)
- None
- Integrity (subsequent systems)
- None
- Availability (subsequent systems)
- None
CVSS 3.1 5.3
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- Low
Weakness
CWE-674: Uncontrolled Recursion
The product does not properly control the amount of recursion that takes place, consuming excessive resources, such as allocated memory or the program stack.
How to prevent it
- Implementation: Ensure that an end condition will be reached under all logic conditions. The end condition may include checking against the depth of recursion and exiting with an error if the recursion goes too deep. The complexity of the end condition contributes to the effectiveness of this action.
- Implementation: Increase the stack size.
References
Advisories
Fixes and patches
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-7gcm-g887-7qv7 protobuf affected by a JSON recursion depth bypass | High | Also affects protobuf |
| GHSA-8gq9-2x98-w8hf protobuf-cpp and protobuf-python have potential Denial of Service issue | High | Also affects protobuf |
| PYSEC-2022-48 Withdrawn Advisory: NULL Pointer Dereference in Protocol Buffers | High | Also affects protobuf |
| GHSA-jwvw-v7c5-m82h protobuf susceptible to buffer overflow | High | Also affects protobuf |
| GHSA-hqq3-7jhf-c5jx Forge: Denial of service in TLS record processing via call stack exhaustion | High | Same weakness, CWE-674 |
| GHSA-wwpr-jff3-395c Crass: A large number of adjacent CSS comments can trigger a SystemStackError | Medium | Same weakness, CWE-674 |
| GHSA-6jxj-px6v-747w Crass: Deeply nested CSS blocks and functions can trigger a SystemStackError or excessive memory usage | Medium | Same weakness, CWE-674 |
| GHSA-vvm8-gf78-28g4 Go JOSE: Panics in JSON parsing | Medium | Same weakness, CWE-674 |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor