{"id":"CVE-2022-39348","published":"2022-10-26T00:00:00Z","modified":"2025-11-03T21:46:32Z","title":"Twisted vulnerable to NameVirtualHost Host header injection","vendor":"twisted","product":"twisted","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.4,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01586,"percentile":0.76194,"provenance":"source"},"cwes":[{"id":"CWE-80","name":"Improper Neutralization of Script-Related HTML Tags in a Web Page"},{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"references":[{"url":"https://github.com/twisted/twisted/security/advisories/GHSA-vg46-2rrj-3647","tags":[]},{"url":"https://github.com/twisted/twisted/commit/f2f5e81c03f14e253e85fe457e646130780db40b","tags":[]},{"url":"https://github.com/twisted/twisted/commit/f49041bb67792506d85aeda9cf6157e92f8048f4","tags":[]},{"url":"https://lists.debian.org/debian-lts-announce/2022/11/msg00038.html","tags":["mailing-list"]},{"url":"https://security.gentoo.org/glsa/202301-02","tags":["vendor-advisory"]},{"url":"https://lists.debian.org/debian-lts-announce/2024/11/msg00028.html","tags":[]}],"priority":{"score":19.0,"factors":[{"name":"EPSS percentile","points":15.24},{"name":"CVSS severity","points":3.78}]},"vendorSlug":"twisted","affectedVersions":[{"vendor":"twisted","product":"twisted","versions":[">= 0.9.4, < 22.10.0rc1"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2025-04-22T15:43:19.537134Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"Twisted","vulnerableRanges":[">=0.9.4, <22.10.0rc1"],"patched":["22.10.0rc1"],"from":["GHSA-vg46-2rrj-3647","PYSEC-2026-1055"],"provenance":"source"}],"summary":{"text":"The Twisted web framework's twisted.web.vhost.NameVirtualHost component fails to escape the Host header when no configured host matches, returning a 404 NoResource page that reflects the raw header value and allows HTML and script injection. An attacker would need to be able to set the Host header of an HTTP request, which is hard in practice because it generally implies an existing privileged position, and exploitation requires that a user interact with the crafted response (for example by following a link), with the attack otherwise needing low privileges.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T20:34:43Z"},"euvd":{"id":"EUVD-2022-7164","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-twisted-cve-2020-10108","children":[{"from":"CVE-2022-39348","to":"CVE-2024-41671","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/twisted/web/_template_util.py"],"commits":["https://github.com/twisted/twisted/commit/f2f5e81c03f14e253e85fe457e646130780db40b","https://github.com/twisted/twisted/commit/f49041bb67792506d85aeda9cf6157e92f8048f4","https://github.com/twisted/twisted/commit/046a164f89a0f08d3239ecebd750360f8914df33","https://github.com/twisted/twisted/commit/4a930de12fb67e88fefcb8822104152f42b27abc"],"basis":"rarely changed file"}]},{"from":"CVE-2022-39348","to":"CVE-2024-41810","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/twisted/web/_template_util.py"],"commits":["https://github.com/twisted/twisted/commit/f2f5e81c03f14e253e85fe457e646130780db40b","https://github.com/twisted/twisted/commit/f49041bb67792506d85aeda9cf6157e92f8048f4","https://github.com/twisted/twisted/commit/046a164f89a0f08d3239ecebd750360f8914df33"],"basis":"rarely changed file"}]}],"packageHistory":[{"cve":"CVE-2020-10109","published":"2020-03-12","fixed":"20.3.0","kev":false},{"cve":"CVE-2022-21712","published":"2022-02-07","fixed":"22.1.0","kev":false},{"cve":"CVE-2022-24801","published":"2022-04-04","fixed":"22.4.0","kev":false,"link":{"from":"CVE-2022-24801","to":"CVE-2022-39348","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:Twisted","fromFixed":"22.4.0","toFixed":"22.10.0rc1","daysApart":205}]}},{"cve":"CVE-2022-39348","published":"2022-10-26","fixed":"22.10.0rc1","kev":false},{"cve":"CVE-2023-46137","published":"2023-10-25","fixed":"23.10.0rc1","kev":false},{"cve":"CVE-2026-42304","published":"2026-05-13","fixed":"26.4.0","kev":false},{"cve":"CVE-2026-115774","published":"2026-10-23","fixed":"26.10.0rc1","kev":false}],"package":"PyPI:Twisted"}}