# CVE-2022-39348: Twisted vulnerable to NameVirtualHost Host header injection

> Attacker can inject HTML or scripts via Host header in Twisted web applications, potentially leading to code execution.

- **Severity:** Medium 5.4 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 26 Oct 2022
- **Updated:** 3 Nov 2025
- **Also known as:** AZL-11357, DEBIAN-CVE-2022-39348, DLA-3212-1, GHSA-vg46-2rrj-3647, MGASA-2023-0061, OESA-2023-1910, OESA-2023-1911, PYSEC-2026-1055, SUSE-SU-2022:4000-1, SUSE-SU-2022:4057-1, UBUNTU-CVE-2022-39348, openSUSE-SU-2024:12474-1

## What is CVE-2022-39348?

CVE-2022-39348 is a medium-severity cross-site scripting vulnerability in Debian Debian Linux, published on 26 Oct 2022. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

### Official description

Twisted is an event-based framework for internet applications. Started with version 0.9.4, when the host header does not match a configured host `twisted.web.vhost.NameVirtualHost` will return a `NoResource` resource which renders the Host header unescaped into the 404 response allowing HTML and script injection. In practice this should be very difficult to exploit as being able to modify the Host header of a normal HTTP request implies that one is already in a privileged position. This issue was fixed in version 22.10.0rc1. There are no known workarounds.

Weakness: CWE-80 (Improper Neutralization of Script-Related HTML Tags in a Web Page), CWE-79 (Improper Neutralization of Input During Web Page Generation)

## Which versions are affected by CVE-2022-39348?

3 open source packages ship an affected version, including twisted and Twisted. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `twisted` | PyPI | From 0.9.4 | 22.10.0rc1 |
| `twisted` | PyPI | From 0.9.4 | 22.10.0rc1 |
| `Twisted` | PyPI | From 0.9.4 | 22.10.0rc1 |
| `python-Twisted` | SUSE:Linux Enterprise Module for Package Hub 15 SP3 | All versions | 19.10.0-150200.3.18.1 |
| `python-Twisted` | SUSE:Linux Enterprise Module for Server Applications 15 SP3 | All versions | 19.10.0-150200.3.18.1 |
| `python-Twisted` | SUSE:Linux Enterprise Module for Server Applications 15 SP4 | All versions | 22.2.0-150400.5.7.1 |
| `python-Twisted` | openSUSE:Leap 15.3 | All versions | 19.10.0-150200.3.18.1 |
| `python-Twisted` | openSUSE:Leap 15.4 | All versions | 19.10.0-150200.3.18.1 |
| `python-Twisted` | openSUSE:Leap 15.4 | All versions | 22.2.0-150400.5.7.1 |
| `python-Twisted` | openSUSE:Tumbleweed | All versions | 22.10.0-1.1 |

Products: Debian Debian Linux, Twisted Twisted.

## How do I fix CVE-2022-39348?

Upgrade twisted to 22.10.0rc1 or later.

## Is CVE-2022-39348 being exploited?

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

## Other vulnerabilities in Debian Debian Linux

- [CVE-2015-3306](https://insights.sbomify.com/CVE-2015-3306/): ProFTPD Improper Access Control (critical 10.0, exploited in the wild)
- [CVE-2025-49113](https://insights.sbomify.com/CVE-2025-49113/): RoundCube Webmail Deserialization of Untrusted Data (critical 9.9, exploited in the wild)
- [CVE-2026-24061](https://insights.sbomify.com/CVE-2026-24061/): GNU InetUtils Argument Injection (critical 9.8, exploited in the wild)
- [CVE-2025-39682](https://insights.sbomify.com/CVE-2025-39682/): Linux Kernel Improper Check for Unusual or Exceptional Conditions (critical 9.8, exploited in the wild)
- [CVE-2024-9680](https://insights.sbomify.com/CVE-2024-9680/): Mozilla Firefox Use-After-Free (critical 9.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-39348 and fix it if it is affected.

What it is: CVE-2022-39348 is a medium-severity cross-site scripting vulnerability in Debian Debian Linux, published on 26 Oct 2022. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-39348 exists.

Affected packages and fixed versions:
- twisted (PyPI): affected from 0.9.4; fixed in 22.10.0rc1
- twisted (PyPI): affected from 0.9.4; fixed in 22.10.0rc1
- Twisted (PyPI): affected from 0.9.4; fixed in 22.10.0rc1

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

## Sources

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

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