BREW-SCRAPY-CVE-2022-39348 (GHSA-VG46-2RRJ-3647)
Vulnerability from osv_homebrew – Published: 2026-08-13 17:34 – Updated: 2026-09-10 01:11 – Source website
VLAI
Summary
Twisted vulnerable to NameVirtualHost Host header injection
Details
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.
Example configuration:
from twisted.web.server import Site
from twisted.web.vhost import NameVirtualHost
from twisted.internet import reactor
resource = NameVirtualHost()
site = Site(resource)
reactor.listenTCP(8080, site)
reactor.run()
Output:
❯ curl -H"Host:<h1>HELLO THERE</h1>" http://localhost:8080/
<html>
<head><title>404 - No Such Resource</title></head>
<body>
<h1>No Such Resource</h1>
<p>host b'<h1>hello there</h1>' not in vhost map</p>
</body>
</html>
This vulnerability was introduced in f49041bb67792506d85aeda9cf6157e92f8048f4 and first appeared in the 0.9.4 release.
Severity
5.4 (Medium)
References
{
"affected": [
{
"ecosystem_specific": {
"fix": "bump",
"range_state": "fixed",
"resource": "twisted",
"resource_purl": "pkg:pypi/twisted@26.4.0",
"upstream_fixed_in": "22.10.0rc1"
},
"package": {
"ecosystem": "Homebrew",
"name": "scrapy",
"purl": "pkg:brew/scrapy"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.17.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"database_specific": {
"confidence": "high",
"source": "matched",
"strategy": "registry",
"upstream_evidence": [
{
"ecosystem": "PyPI",
"key": "pkg:pypi/twisted@26.4.0",
"name": "twisted",
"resource": "twisted",
"strategy": "registry",
"subject_version": "26.4.0"
}
]
},
"details": "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\u276f curl -H\"Host:\u003ch1\u003eHELLO THERE\u003c/h1\u003e\" http://localhost:8080/\n\n\u003chtml\u003e\n \u003chead\u003e\u003ctitle\u003e404 - No Such Resource\u003c/title\u003e\u003c/head\u003e\n \u003cbody\u003e\n \u003ch1\u003eNo Such Resource\u003c/h1\u003e\n \u003cp\u003ehost b\u0027\u003ch1\u003ehello there\u003c/h1\u003e\u0027 not in vhost map\u003c/p\u003e\n \u003c/body\u003e\n\u003c/html\u003e\n```\n\nThis vulnerability was introduced in f49041bb67792506d85aeda9cf6157e92f8048f4 and first appeared in the 0.9.4 release.",
"id": "BREW-scrapy-CVE-2022-39348",
"modified": "2026-09-10T01:11:46Z",
"published": "2026-08-13T17:34:19Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/twisted/twisted/security/advisories/GHSA-vg46-2rrj-3647"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-39348"
},
{
"type": "WEB",
"url": "https://github.com/twisted/twisted/commit/f2f5e81c03f14e253e85fe457e646130780db40b"
},
{
"type": "WEB",
"url": "https://github.com/twisted/twisted/commit/f49041bb67792506d85aeda9cf6157e92f8048f4"
},
{
"type": "PACKAGE",
"url": "https://github.com/twisted/twisted"
},
{
"type": "WEB",
"url": "https://lists.debian.org/debian-lts-announce/2022/11/msg00038.html"
},
{
"type": "WEB",
"url": "https://lists.debian.org/debian-lts-announce/2024/11/msg00028.html"
},
{
"type": "WEB",
"url": "https://security.gentoo.org/glsa/202301-02"
}
],
"schema_version": "1.7.3",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N",
"type": "CVSS_V3"
},
{
"score": "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",
"type": "CVSS_V4"
}
],
"summary": "Twisted vulnerable to NameVirtualHost Host header injection",
"upstream": [
"GHSA-vg46-2rrj-3647",
"CVE-2022-39348",
"PYSEC-2026-1055"
]
}
Loading…
Loading…
Experimental. This forecast is provided for visualization only and may change without notice. Do not use it for operational decisions.
Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Loading…
The MITRE ATT&CK techniques below are AI-generated suggestions, inferred from the description of the
vulnerability by the CIRCL/vulnerability-attack-technique-classification-roberta-base
model, served locally by ML-Gateway.
They have not been verified by an analyst and are provided for guidance only.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Loading…
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.
Loading…