---
id: "CVE-2026-83813"
kind: "vulnerability"
aliases: ["CVE-2026-83813"]
title: "Twisted: DNS resolver accepts forged UDP answers from any source"
severity: "low"
cvss: 3.1
epss: 0.00162
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["package", "python", "self-hosted", "twisted"]
not_affected_if: ["no-twisted-dns-use"]
published_at: "2026-10-23T21:17:25+00:00"
first_seen_at: "2026-10-23T21:57:34+00:00"
updated_at: "2026-10-25T12:38:49+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-83813", "first_seen_at": "2026-10-23T21:57:34+00:00"}, {"source": "epss", "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-83813", "first_seen_at": "2026-10-25T12:38:49+00:00"}]
---

# Twisted: DNS resolver accepts forged UDP answers from any source

Twisted's DNS datagram protocol accepts a UDP reply whose 16-bit transaction ID matches a pending query without checking the sender's address and port. An off-path attacker who can send packets to the resolver and guess the transaction ID can inject a fake answer, redirecting hostname lookups for mail interception, SSRF or man-in-the-middle positioning.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed Twisted version with `python -c "import twisted; print(twisted.__version__)"` or `pip show twisted`
- Look for code that reuses a single `DNSDatagramProtocol` instance for multiple queries, since the search space is reduced after the first query

## Fix

- Upgrade Twisted to `26.10.0rc1` or later

## Timeline

- 2026-10-23T21:57:34+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-83813
- 2026-10-25T12:38:49+00:00 epss https://api.first.org/data/v1/epss?cve=CVE-2026-83813

## From the sources

Twisted is an event-based framework for internet applications, supporting Python 3.6+. Prior to 26.10.0rc1, twisted.names.dns.DNSDatagramProtocol accepts a UDP DNS response for a pending query when its 16-bit transaction ID matches but does not verify that the response came from the queried host and port. An attacker able to deliver a packet to the resolver's listening port with the correct transaction ID can inject a forged answer. The standard twisted.names.client.Resolver uses a new random source port for each query, increasing off-path attack complexity, while applications that reuse a DNSDatagramProtocol instance expose only the transaction-ID search space after the first query. A successful forgery can redirect hostname resolution and enable mail interception, server-side request forgery, or man-in-the-middle positioning. This issue is fixed in version 26.10.0rc1.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
