Packet of death for DNSCrypt over TCP
Summary
| CVE | CVE-2026-40691 |
|---|---|
| State | PUBLISHED |
| Assigner | NLnet Labs |
| Source Priority | CVE Program / NVD first with legacy fallback |
| Published | 2026-07-22 14:17:18 UTC |
| Updated | 2026-07-22 20:33:11 UTC |
| 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. |
Risk And Classification
Primary CVSS: v3.1 7.5 HIGH from [email protected]
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Problem Types: CWE-122 | CWE-787 | CWE-122 CWE-122: Heap-based Buffer Overflow | CWE-787 CWE-787: Out-of-bounds Write
| Version | Source | Type | Score | Severity | Vector |
|---|---|---|---|---|---|
| 3.1 | [email protected] | Secondary | 7.5 | HIGH | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| 3.1 | CNA | CVSS | 7.5 | HIGH | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
CVSS v3.1 Breakdown
Attack Vector
NetworkAttack Complexity
LowPrivileges Required
NoneUser Interaction
NoneScope
UnchangedConfidentiality
NoneIntegrity
NoneAvailability
HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Vendor Declared Affected Products
| Source | Vendor | Product | Version | Platforms |
|---|---|---|---|---|
| CNA | NLnet Labs | Unbound | affected 1.9.0 1.25.2 semver | Not specified |
References
| Reference | Source | Link | Tags |
|---|---|---|---|
| www.nlnetlabs.nl/downloads/unbound/CVE-2026-40691.txt | [email protected] | www.nlnetlabs.nl | |
| CVE Program record | CVE.ORG | www.cve.org | canonical |
| NVD vulnerability detail | NVD | nvd.nist.gov | canonical, analysis |
Vendor Comments And Credit
Discovery Credit
CNA: Qifan Zhang (Palo Alto Networks) (en)
CNA: Trung Nguyen (@everping, CyStack) (en)
Additional Advisory Data
| Source | Time | Event |
|---|---|---|
| CNA | 2026-05-18T00:00:00.000Z | Issue reported by Qifan Zhang |
| CNA | 2026-06-10T00:00:00.000Z | NLnet Labs shares patch with Qifan Zhang |
| CNA | 2026-06-13T00:00:00.000Z | Qifan Zhang verifies patch |
| CNA | 2026-06-30T00:00:00.000Z | Issue reported by Trung Nguyen |
| CNA | 2026-07-02T00:00:00.000Z | NLnet Labs shares patch with Trung Nguyen |
| CNA | 2026-07-02T00:00:00.000Z | Trung Nguyen suggests extra fixes |
| CNA | 2026-07-03T00:00:00.000Z | NLnet Labs shares new version of the patch with Trung Nguyen |
| CNA | 2026-07-04T00:00:00.000Z | Trung Nguyen verifies patch |
| CNA | 2026-07-22T00:00:00.000Z | Fixes released with version 1.25.2 |
Solutions
CNA: This issue is fixed starting with version 1.25.2
There are currently no legacy QID mappings associated with this CVE.