CVE-2026-40691
Received Received - Intake

Buffer Overflow in Unbound DNS Resolver via DNSCrypt TCP Queries

Vulnerability report for CVE-2026-40691, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-22

Last updated on: 2026-07-22

Assigner: NLnet Labs

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 Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-22
Last Modified
2026-07-22
Generated
2026-07-22
AI Q&A
2026-07-22
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
nlnetlabs unbound From 1.9.0 (inc) to 1.25.1 (inc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-787 The product writes data past the end, or before the beginning, of the intended buffer.
CWE-122 A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc().

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This is a denial of service vulnerability in Unbound DNS resolver software versions 1.9.0 to 1.25.1 when compiled with DNSCrypt support. It occurs when a maliciously crafted DNSCrypt query is sent over TCP, causing a heap overflow that crashes the server. The issue happens because the software fails to properly check buffer sizes when processing encrypted replies, allowing replies larger than 65504 bytes to exceed allocated memory.

Detection Guidance

To detect this vulnerability, check if Unbound is running with DNSCrypt support enabled and if the 'dnscrypt:' clause is configured for listening interfaces. Inspect Unbound logs for crashes or errors related to DNSCrypt queries over TCP. Use commands like 'unbound -V' to check version and compilation flags, and 'ss -tulnp | grep unbound' to verify listening ports.

Impact Analysis

A single malicious encrypted query can crash the resolver, leading to a denial of service. This means the DNS server would stop responding to legitimate queries, disrupting network services that rely on it.

Compliance Impact

This vulnerability primarily causes denial of service by crashing the Unbound DNS resolver, which could disrupt network services and data processing. For GDPR, this may impact availability of services handling personal data. For HIPAA, it could affect the availability of systems processing protected health information. However, the vulnerability does not directly lead to data breaches or unauthorized access.

Mitigation Strategies

Immediately upgrade Unbound to version 1.25.2 or later, which includes fixes for this issue. If upgrading is not possible, disable DNSCrypt support by recompiling Unbound without the '--enable-dnscrypt' flag or removing the 'dnscrypt:' clause from the configuration. Monitor for crashes or unusual activity in Unbound logs.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-40691. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart