CVE-2026-40691 PUBLISHED

Packet of death for DNSCrypt over TCP

Assigner: NLnet Labs
Reserved: 22.06.2026 Published: 22.07.2026 Updated: 22.07.2026

In Unbound 1.9.0 up to and including 1.25.1, when a DNSCrypt query is received over TCP, the routine that encrypts the reply in place fails to bound the reply length against the destination buffer size. The size clamp that protects the UDP path is not applied on the TCP path, so a reply larger than 65504 bytes is shifted forward by 48 bytes inside a buffer of capacity equal to 'msg-buffer-size', writing past the end of the heap allocation. A single malicious encrypted query crashes the resolver and lead to denial of service. This vulnerability needs Unbound to be compiled with DNSCrypt support ('--enable-dnscrypt') and the 'dnscrypt:' clause to be configured and enabled for the listening interfaces.

Metrics

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
CVSS Score: 7.5

Unbound compiled with DNSCrypt ('--enable-dnscrypt')

Product Status

Vendor NLnet Labs
Product Unbound
Versions Default: unaffected
  • affected from 1.9.0 to 1.25.2 (excl.)

Solutions

This issue is fixed starting with version 1.25.2

Credits

  • Qifan Zhang (Palo Alto Networks) finder
  • Trung Nguyen (@everping, CyStack) finder

References

Problem Types

  • CWE-122: Heap-based Buffer Overflow CWE
  • CWE-787: Out-of-bounds Write CWE