# CVE-2026-0865: wsgiref.headers.Headers allows header newline injection

> Attackers can inject HTTP headers via newline characters in user-controlled header names or values within the Python wsgiref library.

- **Severity:** Medium 5.9 (`CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 20 Jan 2026
- **Updated:** 3 Mar 2026
- **Also known as:** AZL-75032, AZL-75053, AZL-84272, BELL-CVE-2026-0865, BIT-libpython-2026-0865, BIT-python-2026-0865, BIT-python-min-2026-0865, DEBIAN-CVE-2026-0865, ECHO-161c-5786-cb70, GHSA-5mc7-p6pj-r3f5, MINI-8fcx-736x-vj46, MINI-99vm-pp5c-jc8p, MINI-fh4c-v6j3-p5x7, MINI-fp4p-227x-m3w2, MINI-jqfv-cqgf-j82c, PSF-2026-6, RHSA-2026:18693, RHSA-2026:18957, RHSA-2026:18958

## What is CVE-2026-0865?

CVE-2026-0865 is a medium-severity vulnerability in CPython, published on 20 Jan 2026. An attacker needs administrator access to exploit it, with no action from the victim.

### Official description

User-controlled header names and values containing newlines can allow injecting HTTP headers.

Weakness: CWE-74 (Improper Neutralization of Special Elements in Output Used by a Downstream Component)

## Which versions are affected by CVE-2026-0865?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libpython` | Bitnami | All versions | 3.10.20, 3.11.15, 3.12.13, 3.13.12, 3.14.3 |
| `python` | Bitnami | All versions | 3.10.20, 3.11.15, 3.12.13, 3.13.12, 3.14.3 |
| `python-min` | Bitnami | All versions | 3.10.20, 3.11.15, 3.12.13, 3.13.12, 3.14.3 |
| `python-unversioned-command` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.9.25-5.el9_8 |
| `python3-devel` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.9.25-5.el9_8 |
| `python3-tkinter` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.9.25-5.el9_8 |
| `python3.11` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.11.13-7.el9_8 |
| `python3.11-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.11.13-7.el9_8 |
| `python3.11-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.11.13-7.el9_8 |
| `python3.11-devel` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.11.13-7.el9_8 |
| `python3.11-libs` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.11.13-7.el9_8 |
| `python3.11-tkinter` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.11.13-7.el9_8 |
| `python3.12` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.12.12-6.el9_8 |
| `python3.12-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.12.12-6.el9_8 |
| `python3.12-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.12.12-6.el9_8 |
| `python3.12-devel` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.12.12-6.el9_8 |
| `python3.12-libs` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.12.12-6.el9_8 |
| `python3.12-tkinter` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.12.12-6.el9_8 |
| `python3.9-debuginfo` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.9.25-5.el9_8 |
| `python3.9-debugsource` | Red Hat:enterprise_linux:9::appstream | All versions | 0:3.9.25-5.el9_8 |
| `python3` | Red Hat:enterprise_linux:9::baseos | All versions | 0:3.9.25-5.el9_8 |
| `python3-libs` | Red Hat:enterprise_linux:9::baseos | All versions | 0:3.9.25-5.el9_8 |
| `python3.9` | Red Hat:enterprise_linux:9::baseos | All versions | 0:3.9.25-5.el9_8 |
| `python3.9-debuginfo` | Red Hat:enterprise_linux:9::baseos | All versions | 0:3.9.25-5.el9_8 |
| `python3.9-debugsource` | Red Hat:enterprise_linux:9::baseos | All versions | 0:3.9.25-5.el9_8 |
| `python3` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.9.25-5.el9_8 |
| `python3-debug` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.9.25-5.el9_8 |
| `python3-idle` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.9.25-5.el9_8 |
| `python3-test` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.9.25-5.el9_8 |
| `python3-tkinter` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.9.25-5.el9_8 |
| `python3.11` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.11.13-7.el9_8 |
| `python3.11-debug` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.11.13-7.el9_8 |
| `python3.11-debuginfo` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.11.13-7.el9_8 |
| `python3.11-debugsource` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.11.13-7.el9_8 |
| `python3.11-idle` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.11.13-7.el9_8 |
| `python3.11-test` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.11.13-7.el9_8 |
| `python3.11-tkinter` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.11.13-7.el9_8 |
| `python3.12` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.12.12-6.el9_8 |
| `python3.12-debug` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.12.12-6.el9_8 |
| `python3.12-debuginfo` | Red Hat:enterprise_linux:9::crb | All versions | 0:3.12.12-6.el9_8 |

## How do I fix CVE-2026-0865?

Upgrade libpython to a fixed version for your release line: 3.10.20, 3.11.15, 3.12.13 or 3.13.12.

## Is CVE-2026-0865 being exploited?

There is no known exploitation of CVE-2026-0865 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-0865 and fix it if it is affected.

What it is: CVE-2026-0865 is a medium-severity vulnerability in CPython, published on 20 Jan 2026. An attacker needs administrator access to exploit it, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-0865 in the wild and no public exploit code.

Affected packages and fixed versions:
- libpython (Bitnami): affected all versions; fixed in 3.10.20, 3.11.15, 3.12.13, 3.13.12, 3.14.3
- python (Bitnami): affected all versions; fixed in 3.10.20, 3.11.15, 3.12.13, 3.13.12, 3.14.3
- python-min (Bitnami): affected all versions; fixed in 3.10.20, 3.11.15, 3.12.13, 3.13.12, 3.14.3

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-2026-0865/ (Markdown: https://insights.sbomify.com/CVE-2026-0865/index.md)
```

## Sources

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

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