{"id":"CVE-2022-39348","aliases":["CVE-2022-39348","GHSA-vg46-2rrj-3647","PYSEC-2026-1055"],"related":[],"kind":"vulnerability","state":"published","title":"Twisted vulnerable to NameVirtualHost Host header injection","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","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.","source":"cvelist"},{"lang":"en","text":"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.\n\nExample configuration:\n```python\nfrom twisted.web.server import Site\nfrom twisted.web.vhost import NameVirtualHost\nfrom twisted.internet import reactor\n\nresource = NameVirtualHost()\nsite = Site(resource)\nreactor.listenTCP(8080, site)\nreactor.run()\n```\nOutput:\n```\n❯ curl -H\"Host:<h1>HELLO THERE</h1>\" http://localhost:8080/\n\n<html>\n  <head><title>404 - No Such Resource</title></head>\n  <body>\n    <h1>No Such Resource</h1>\n    <p>host b'<h1>hello there</h1>' not in vhost map</p>\n  </body>\n</html>\n```\n\nThis vulnerability was introduced in f49041bb67792506d85aeda9cf6157e92f8048f4 and first appeared in the 0.9.4 release.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Twisted es un framework basado en eventos para aplicaciones de Internet. Comenzó con la versión 0.9.4, cuando el encabezado del host no coincide con un host configurado \"twisted.web.vhost.NameVirtualHost\" devolverá un recurso \"NoResource\" que hace que el encabezado del Host no sea escondido en la respuesta 404 permitiendo la inyección de HTML y scripts. En la práctica esto debería ser muy difícil de explotar ya que ser capaz de modificar el encabezado Host de una petición HTTP normal implica que uno ya está en una posición privilegiada. Este problema ha sido corregido en versión 22.10.0rc1. No se presenta mitigaciones conocidas","source":"nvd"}],"published":"2022-10-26T00:00:00.000Z","modified":"2026-07-07T11:56:35.965Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","score":5.4,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"}],"cwes":["CWE-79","CWE-80"],"affected":[{"ranges":[{"version":">= 0.9.4, < 22.10.0rc1","status":"affected"}],"vendor":"twisted","product":"twisted","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0.9.4","status":"affected","fixed":"22.10.0rc1"}],"ecosystem":"PyPI","package":"twisted","purl":"pkg:pypi/twisted","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"0.9.4","fixed":"22.10.0"}],"vendor":"twisted","product":"twisted","cpe":"cpe:2.3:a:twisted:twisted:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"10.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0.9.4","status":"affected","fixed":"22.10.0rc1"}],"ecosystem":"PyPI","package":"twisted","purl":"pkg:pypi/twisted","source":"pysec"}],"references":[{"url":"https://github.com/twisted/twisted/security/advisories/GHSA-vg46-2rrj-3647","tags":["exploit","patch","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/twisted/twisted/commit/f2f5e81c03f14e253e85fe457e646130780db40b","tags":["patch","web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/twisted/twisted/commit/f49041bb67792506d85aeda9cf6157e92f8048f4","tags":["patch","web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://lists.debian.org/debian-lts-announce/2022/11/msg00038.html","tags":["mailing-list","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://security.gentoo.org/glsa/202301-02","tags":["third-party-advisory","vendor-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://lists.debian.org/debian-lts-announce/2024/11/msg00028.html","tags":["web"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-39348","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/twisted/twisted","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/twisted","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-vg46-2rrj-3647","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-04-22T15:43:19.537Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-39348","url":"https://www.cve.org/CVERecord?id=CVE-2022-39348","licence":"CVE Terms of Use","modified":"2025-11-03T21:46:32.067Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-vg46-2rrj-3647","url":"https://github.com/advisories/GHSA-vg46-2rrj-3647","licence":"CC-BY-4.0","modified":"2026-07-07T11:56:35.965Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-39348","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-39348","licence":"Public domain","modified":"2026-06-17T04:58:11.477Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-1055","url":"https://osv.dev/vulnerability/PYSEC-2026-1055","licence":"CC-BY-4.0","modified":"2026-07-07T11:46:02.102Z"}],"updatedAt":"2026-11-25T22:58:16.029Z","epss":{"score":0.01586,"percentile":0.76347,"date":"2026-12-02T12:00:21.000Z"}}