Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-40691: CWE-122: Heap-based Buffer Overflow in NLnet Labs Unbound

0
High
VulnerabilityCVE-2026-40691cvecve-2026-40691cwe-122cwe-787
Published: 07/22/2026 (07/22/2026, 13:04:35 UTC)
Source: CVE Database V5
Vendor/Project: NLnet Labs
Product: 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

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Affected software

GitHub Actionsmore threats →ai
nlnetlabs/unbound
pkg:github/nlnetlabs/unbound
Affected versions
=1.9.0<=1.25.1

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/22/2026, 13:37:23 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses