{"id":"CVE-2025-4565","aliases":["CVE-2025-4565","GHSA-8qvm-5x2c-j2w7","PYSEC-2026-1806"],"related":[],"kind":"vulnerability","state":"published","title":"Unbounded recursion in Python Protobuf","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. This can result in a Denial of service by crashing the application with a RecursionError. We recommend upgrading to version =>6.31.1 or beyond commit 17838beda2943d08b8a9d4df5b68f5f04f26d901","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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. This can result in a Denial of service by crashing the application with a RecursionError. We recommend upgrading to version =>6.31.1 or beyond commit 17838beda2943d08b8a9d4df5b68f5f04f26d901","source":"cvelist"},{"lang":"en","text":"### 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)","format":"markdown","source":"ghsa"},{"lang":"es","text":"Cualquier proyecto que utilice el backend Protobuf Pure-Python para analizar datos de Protocol Buffers no confiables que contengan un número arbitrario de grupos recursivos, mensajes recursivos o una serie de etiquetas SGROUP puede corromperse al exceder el límite de recursión de Python. Esto puede provocar una denegación de servicio (DSP) que bloquea la aplicación con un RecursionError. Recomendamos actualizar a la versión 6.31.1 o posterior (commit 17838beda2943d08b8a9d4df5b68f5f04f26d901).","source":"nvd"}],"published":"2025-06-16T14:50:40.906Z","modified":"2026-09-10T03:50:25.255Z","severity":{"scorer":"Google","scheme":"CVSS:4.0","vector":"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","score":8.2,"rating":"HIGH"},"severities":[{"scorer":"Google","scheme":"CVSS:4.0","vector":"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","score":8.2,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"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"}],"cwes":["CWE-674"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"4.25.8","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.29.5","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.31.1","status":"affected"}],"vendor":"protocolbuffers","product":"Python-Protobuf","package":"protobuf","repo":"https://github.com/protocolbuffers/protobuf/","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","fixed":"4.25.8","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.29.5","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.31.1","status":"affected"}],"vendor":"protocolbuffers","product":"Python-Protobuf","repo":"https://pypi.org/project/protobuf/","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.25.8"}],"ecosystem":"PyPI","package":"protobuf","purl":"pkg:pypi/protobuf","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"5.26.0rc1","status":"affected","fixed":"5.29.5"}],"ecosystem":"PyPI","package":"protobuf","purl":"pkg:pypi/protobuf","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"6.30.0rc1","status":"affected","fixed":"6.31.1"}],"ecosystem":"PyPI","package":"protobuf","purl":"pkg:pypi/protobuf","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"4.25.8"},{"status":"affected","introduced":"5.26.0","fixed":"5.29.5"},{"status":"affected","introduced":"6.30.0","fixed":"6.31.1"}],"vendor":"google","product":"protobuf-python","cpe":"cpe:2.3:a:google:protobuf-python:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.25.8"},{"type":"ecosystem","introduced":"5.26.0rc1","status":"affected","fixed":"5.29.5"},{"type":"ecosystem","introduced":"6.30.0rc1","status":"affected","fixed":"6.31.1"}],"ecosystem":"PyPI","package":"protobuf","purl":"pkg:pypi/protobuf","source":"pysec"}],"references":[{"url":"https://github.com/protocolbuffers/protobuf/commit/17838beda2943d08b8a9d4df5b68f5f04f26d901","tags":["patch","web"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/protocolbuffers/protobuf/security/advisories/GHSA-735f-pc8j-v9w8","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/protocolbuffers/protobuf/security/advisories/GHSA-8qvm-5x2c-j2w7","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-4565","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/protocolbuffers/protobuf","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://github.com/protocolbuffers/protobuf/blob/main/python/google/protobuf/internal/decoder_test.py#L87-L98","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/protocolbuffers/protobuf/blob/main/python/google/protobuf/internal/message_test.py#L1436-L1478","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/protocolbuffers/protobuf/tree/main/python#implementation-backends","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/protobuf","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-8qvm-5x2c-j2w7","tags":["advisory"],"sources":["pysec"]}],"credits":["Alexis Challande - Trail of Bits Ecosystem Security Team"],"assigner":"Google","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2025-06-16T15:38:57.654Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-4565","url":"https://www.cve.org/CVERecord?id=CVE-2025-4565","licence":"CVE Terms of Use","modified":"2025-06-16T15:39:18.263Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-8qvm-5x2c-j2w7","url":"https://github.com/advisories/GHSA-8qvm-5x2c-j2w7","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:25.255Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-4565","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-4565","licence":"Public domain","modified":"2026-06-17T09:33:31.963Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-1806","url":"https://osv.dev/vulnerability/PYSEC-2026-1806","licence":"CC-BY-4.0","modified":"2026-07-07T17:48:07.186Z"}],"updatedAt":"2026-11-25T22:58:59.250Z","epss":{"score":0.00259,"percentile":0.18781,"date":"2026-12-01T12:00:22.000Z"}}