PHP2Shell: Read our blog on the critical RCE vulnerabilities affecting 70% of the Internet

CVE-2026-83813: 
Python vulnerability analysis and mitigation

Overview

CVE-2026-83813 is a DNS response spoofing vulnerability in the Twisted networking library's twisted.names DNS client, caused by missing source address validation in DNSDatagramProtocol. The flaw allows any host capable of delivering a UDP packet with a matching 16-bit transaction ID to inject forged DNS answers, independent of the real DNS server's address. It affects all Twisted versions up to and including 26.4.0, with a fix available in version 26.10.0rc1. The vulnerability carries a CVSS v3.1 base score of 3.1 (Low) (GitHub Advisory).

Technical details

The root cause is an Origin Validation Error (CWE-346) in DNSDatagramProtocol.datagramReceived (src/twisted/names/dns.py, line 3350), which accepts DNS responses based solely on a matching 16-bit transaction ID without verifying the source address of the UDP datagram. The listening socket is created with listenUDP(0, self, maxPacketSize=512) and is not connected to the queried server, so the OS kernel performs no source-address filtering either. While twisted.names.client.Resolver mitigates brute-force attacks by creating a new DNSDatagramProtocol instance with a fresh random source port per query (providing ~32 bits of combined entropy), code that uses DNSDatagramProtocol directly across multiple queries reuses the same port, reducing the attacker's guessing space to just the 16-bit transaction ID. A public proof-of-concept demonstrating successful injection of a forged A record from an unrelated local socket is included in the advisory (GitHub Advisory).

Impact

A successful exploit allows an attacker to redirect hostname resolution to an arbitrary IP address, enabling mail interception via spoofed MX/A records, server-side request forgery (SSRF), or man-in-the-middle positioning against any service that trusts the resolved address. Applications using twisted.mail for MX lookups are directly affected. On-path attackers or those sharing a broadcast domain or NAT segment with the resolver face no meaningful barrier, as source-address validation is the precise control that would otherwise stop them (GitHub Advisory).

Exploitability

A public proof-of-concept is included in the GitHub Security Advisory, demonstrating that a forged DNS response from an unrelated UDP socket is accepted by the resolver when the transaction ID matches. The CVE was reserved but details were published on October 22, 2026. No in-the-wild exploitation, threat actor attribution, EPSS score, or CISA KEV listing has been reported at this time. Off-path exploitation against the standard client.Resolver requires winning a ~32-bit combined guess (port + transaction ID) within the query timeout, while direct DNSDatagramProtocol usage reduces this to a 16-bit (1-in-65,536) guess (GitHub Advisory).

Exploitation steps

  1. Reconnaissance: Identify an application using Twisted's DNS client (twisted.names.client.Resolver, createResolver, or twisted.mail MX lookups) and determine the resolver's listening UDP port — either by network observation or by targeting code that uses DNSDatagramProtocol directly (which reuses the same port across queries).
  2. Trigger a DNS query: Cause the target application to issue a DNS query for a hostname of interest (e.g., by sending an email to trigger MX resolution, or by initiating any network connection that requires DNS resolution).
  3. Observe or guess the transaction ID: The 16-bit transaction ID is generated with secureRandom, so it must be guessed (1-in-65,536 per attempt) or observed if the attacker is on-path. For DNSDatagramProtocol used directly across multiple queries, the source port is fixed after the first query, reducing the search space to the transaction ID alone.
  4. Craft a forged DNS response: Construct a DNS response message with the matching transaction ID, setting the answer section to the attacker-controlled IP address (e.g., 6.6.6.6).
  5. Deliver the forged UDP packet: Send the crafted UDP datagram to the resolver's listening port from any source address — the resolver performs no source-address check and will accept the response if the transaction ID matches.
  6. Achieve DNS hijacking: The resolver accepts the forged answer, redirecting subsequent connections for the target hostname to the attacker's IP, enabling MITM, SSRF, or mail interception (GitHub Advisory).

Indicators of compromise

  • Network: Unexpected UDP packets arriving at the Twisted resolver's ephemeral port from source addresses other than the configured DNS server; multiple rapid UDP responses to the resolver's port with varying transaction IDs (brute-force attempts).
  • Logs: Twisted application logs showing DNS resolution returning unexpected or attacker-controlled IP addresses for known-good hostnames; DNS query/response mismatches if DNS traffic is logged.
  • Process/Application Behavior: Outbound connections from the Twisted application to unexpected IP addresses following DNS resolution; mail delivery failures or redirections to unexpected mail servers in twisted.mail deployments.

Mitigation and workarounds

Upgrade Twisted to version 26.10.0rc1 or later, which includes a fix for the missing source address validation in DNSDatagramProtocol. As a workaround, avoid using DNSDatagramProtocol directly across multiple queries on a single instance; instead, use twisted.names.client.Resolver (which rotates source ports per query) to benefit from the ~32-bit combined entropy. Additionally, deploying DNSSEC validation or using a local validating resolver (e.g., Unbound) as an upstream can provide an independent layer of protection against forged responses (GitHub Advisory).

Community reactions

The vulnerability was reported by researcher tinyb0y and published by Twisted maintainer adiroiban via GitHub Security Advisory on October 22, 2026. No broader media coverage or notable social media reactions have been identified at this time (GitHub Advisory).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Affected

bookworm

twisted

Affected

sid

twisted

Affected

trixie

twisted

Affected

RHEL / CentOS

Unknown

Source: This report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-49wc-vv82-h8j7CRITICAL9.3
  • Python logoPython
  • harp-proxy
NoYesOct 24, 2026
GHSA-jpw8-42g9-g437HIGH7.4
  • Python logoPython
  • harp-proxy
NoNoOct 24, 2026
GHSA-vvjr-4qwm-6xjxMEDIUM4.8
  • Python logoPython
  • harp-proxy
NoNoOct 24, 2026
GHSA-rr87-p3f8-qhxjHIGHN/A
  • Python logoPython
  • memtomem
NoYesOct 24, 2026
GHSA-3v6c-9qpg-gf63HIGHN/A
  • Python logoPython
  • memtomem-stm
NoYesOct 24, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management