CVE-2022-39348Twisted vulnerable to NameVirtualHost Host header injection
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
Fixed builds are available from Debian, PyPI, Ubuntu: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.04 | twisted | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | twisted | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | twisted | Not affected vulnerable_code_not_present | ||
| Ubuntu 22.04 | twisted | Fixed | 22.1.0-2ubuntu2.4 | UBUNTU-CVE-2022-39348 |
| Ubuntu 20.04 | twisted | Fixed | 18.9.0-11ubuntu0.20.04.3 | UBUNTU-CVE-2022-39348 |
| Ubuntu 18.04 | twisted | Fix pending | UBUNTU-CVE-2022-39348 | |
| Ubuntu 16.04 | twisted | Fix pending | UBUNTU-CVE-2022-39348 | |
| Ubuntu 14.04 | twisted | Fix pending | UBUNTU-CVE-2022-39348 | |
| Debian 14 | twisted | Fixed | 22.4.0-4 | DEBIAN-CVE-2022-39348 |
| Debian 13 | twisted | Fixed | 22.4.0-4 | DEBIAN-CVE-2022-39348 |
| Debian 12 | twisted | Fixed | 22.4.0-4 | DEBIAN-CVE-2022-39348 |
| Red Hat Enterprise Linux 7 | python-twisted-core | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | python-twisted-core-doc | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | python-twisted-web | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 7 | python-twisted-words | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | python-twisted | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | python-twisted-conch | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | python-twisted-core | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | python-twisted-core-doc | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | python-twisted-core-zsh | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | python-twisted-lore | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | python-twisted-mail | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | python-twisted-names | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | python-twisted-news | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | python-twisted-runner | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | python-twisted-web | Will not fix Out of support scope | ||
| Red Hat Enterprise Linux 6 | python-twisted-words | Will not fix Out of support scope | ||
| PyPI library | twisted | Fixed | 22.10.0rc1 | PYSEC-2026-1055 |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- twisted: affected: >= 0.9.4, < 22.10.0rc1
Vendor advisories:
- https://security.gentoo.org/glsa/202301-02 (vendor-advisory)
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
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.