CVE-2026-40691: CWE-122: Heap-based Buffer Overflow in NLnet Labs Unbound
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.
AI Analysis
Technical Summary
In Unbound versions 1.9.0 up to and including 1.25.1, when processing DNSCrypt queries over TCP, the reply encryption routine fails to apply a size clamp on the reply length against the destination buffer size. This omission leads to a heap-based buffer overflow when a reply larger than 65504 bytes is shifted forward by 48 bytes inside a buffer sized by 'msg-buffer-size'. This overflow writes beyond the allocated heap memory, causing a crash and denial of service. The vulnerability only manifests if Unbound is compiled with DNSCrypt support and the 'dnscrypt:' clause is enabled on the listening interfaces.
Potential Impact
An attacker can send a specially crafted DNSCrypt query over TCP that triggers a heap-based buffer overflow in the Unbound resolver. This results in a crash of the resolver process, causing denial of service. There is no indication of confidentiality or integrity impact. No known exploits in the wild have been reported.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid enabling DNSCrypt support in Unbound or disable the 'dnscrypt:' clause on listening interfaces to prevent exposure. Monitor vendor communications for updates and apply official patches once released.
CVE-2026-40691: CWE-122: Heap-based Buffer Overflow in NLnet Labs Unbound
Description
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.
CVSS v3.1
Score 7.5high
Affected software
pkg:github/nlnetlabs/unboundRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
In Unbound versions 1.9.0 up to and including 1.25.1, when processing DNSCrypt queries over TCP, the reply encryption routine fails to apply a size clamp on the reply length against the destination buffer size. This omission leads to a heap-based buffer overflow when a reply larger than 65504 bytes is shifted forward by 48 bytes inside a buffer sized by 'msg-buffer-size'. This overflow writes beyond the allocated heap memory, causing a crash and denial of service. The vulnerability only manifests if Unbound is compiled with DNSCrypt support and the 'dnscrypt:' clause is enabled on the listening interfaces.
Potential Impact
An attacker can send a specially crafted DNSCrypt query over TCP that triggers a heap-based buffer overflow in the Unbound resolver. This results in a crash of the resolver process, causing denial of service. There is no indication of confidentiality or integrity impact. No known exploits in the wild have been reported.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid enabling DNSCrypt support in Unbound or disable the 'dnscrypt:' clause on listening interfaces to prevent exposure. Monitor vendor communications for updates and apply official patches once released.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- NLnet Labs
- Date Reserved
- 2026-06-22T10:11:10.532Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a60c4209c2644c7f80e912b
Added to database: 07/22/2026, 13:22:40 UTC
Last enriched: 07/22/2026, 13:37:23 UTC
Last updated: 07/23/2026, 02:51:53 UTC
Views: 5
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.