# CVE-2023-36632: Denial of service in n/a

> Attackers can cause a denial of service via recursion error in Python's legacy email parsing function using crafted input.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 25 Jun 2023
- **Updated:** 27 Nov 2024
- **Also known as:** AZL-109665, BIT-libpython-2023-36632, BIT-python-2023-36632, BIT-python-min-2023-36632, ECHO-f330-0e36-0681, GHSA-gv66-v8c8-v69c, MINI-w64c-fj8j-jm38, PSF-2023-4

## What is CVE-2023-36632?

CVE-2023-36632 is a high-severity denial of service vulnerability in Python Python, published on 25 Jun 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The legacy email.utils.parseaddr function in Python through 3.11.4 allows attackers to trigger "RecursionError: maximum recursion depth exceeded while calling a Python object" via a crafted argument. This argument is plausibly an untrusted value from an application's input data that was supposed to contain a name and an e-mail address. NOTE: email.utils.parseaddr is categorized as a Legacy API in the documentation of the Python email package. Applications should instead use the email.parser.BytesParser or email.parser.Parser class. NOTE: the vendor's perspective is that this is neither a vulnerability nor a bug. The email package is intended to have size limits and to throw an exception when limits are exceeded; they were exceeded by the example demonstration code.

Weakness: CWE-674 (Uncontrolled Recursion)

## Which versions are affected by CVE-2023-36632?

3 open source packages ship an affected version, including libpython, python and python-min. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libpython` | Bitnami | All versions | 3.11.5 |
| `python` | Bitnami | All versions | 3.11.5 |
| `python-min` | Bitnami | All versions | 3.11.5 |

Products: Python Python.

## How do I fix CVE-2023-36632?

Upgrade libpython to 3.11.5 or later.

## Is CVE-2023-36632 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-36632 exists.

## Other vulnerabilities in Python Python

- [CVE-2008-5031](https://insights.sbomify.com/CVE-2008-5031/): Integer overflow in n/a (critical 10.0)
- [CVE-2014-4650](https://insights.sbomify.com/CVE-2014-4650/): Path traversal in n/a (critical 9.8)
- [CVE-2016-5636](https://insights.sbomify.com/CVE-2016-5636/): Integer overflow in n/a (critical 9.8)
- [CVE-2007-4559](https://insights.sbomify.com/CVE-2007-4559/): Path traversal in n/a (critical 9.8)
- [CVE-2017-17522](https://insights.sbomify.com/CVE-2017-17522/): Command injection in n/a (high 8.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-36632 and fix it if it is affected.

What it is: CVE-2023-36632 is a high-severity denial of service vulnerability in Python Python, published on 25 Jun 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-36632 exists.

Affected packages and fixed versions:
- libpython (Bitnami): affected all versions; fixed in 3.11.5
- python (Bitnami): affected all versions; fixed in 3.11.5
- python-min (Bitnami): affected all versions; fixed in 3.11.5

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-36632/ (Markdown: https://insights.sbomify.com/CVE-2023-36632/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-36632
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-36632
- OSV: https://osv.dev/vulnerability/CVE-2023-36632

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-36632/
Summaries are generated and may contain mistakes; the official description above is the record.
