Skip to main content
Vulnerability Database/CVE-2026-101341

CVE-2026-101341: NSD DNS Server Buffer Overflow Vulnerability

CVE-2026-101341 is a buffer overflow flaw in NSD DNS server that allows arbitrary out-of-bounds stack writes through malformed zone files. This article covers the technical details, affected versions, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-101341 Overview

CVE-2026-101341 is a stack-based buffer overflow [CWE-121] in NLnet Labs NSD (Name Server Daemon). The flaw affects how NSD parses text tokens in RDATA fields, such as those found in TXT records. Text tokens under 32 bytes are not bounds-checked against the space reserved for RDATA. An attacker who can supply a crafted zone file to NSD can trigger arbitrary-sized out-of-bounds stack writes. The overflow can overwrite a callback function pointer that is invoked immediately after parsing, enabling control-flow hijack. Zone files written by NSD itself (for example, secondary zones) are not formatted in a way that triggers the bug; the malicious zone file must be fed directly to NSD.

Critical Impact

Arbitrary stack writes and callback function pointer overwrite in NSD can lead to code execution on an authoritative DNS server when a crafted zone file is loaded.

Affected Products

  • NLnet Labs NSD (Name Server Daemon)
  • Deployments that load operator- or provisioning-supplied zone files directly
  • Primary authoritative nameservers accepting externally sourced zone files

Discovery Timeline

  • 2026-10-14 - CVE CVE-2026-101341 published to NVD
  • 2026-10-14 - Last updated in NVD database

Technical Details for CVE-2026-101341

Vulnerability Analysis

The vulnerability resides in the NSD zone file parser, specifically in the routine that handles text tokens inside RDATA. RDATA refers to the resource data section of a DNS record, and TXT records are a common carrier of free-form text tokens. NSD reserves a fixed buffer on the stack for RDATA during parse. For text tokens shorter than 32 bytes, the parser skips the bounds check that normally keeps writes within that reservation. A sequence of short tokens can therefore write past the end of the RDATA buffer, corrupting adjacent stack memory. Because a callback function pointer sits on the stack and is invoked directly after parsing, an attacker can redirect execution to a chosen address. The requirement for a crafted zone file is the primary mitigating factor, but provisioning pipelines and operator-controlled tooling can still deliver attacker-influenced content.

Root Cause

The parser applies length validation only to text tokens of 32 bytes or more. Short tokens bypass the check and are written directly into the RDATA stack buffer. This classifies as [CWE-121] Stack-based Buffer Overflow.

Attack Vector

Exploitation requires that a malicious zone file be loaded directly by NSD. The zone file can originate from an operator-controlled provisioning system, a shared configuration repository, or any upstream source that feeds raw zone data into NSD. Secondary zones transferred by NSD via AXFR/IXFR and rewritten by NSD are not affected because NSD's own serializer does not emit the vulnerable token layout.

// No verified proof-of-concept code is published.
// See the NLnet Labs advisory for technical details:
// https://www.nlnetlabs.nl/downloads/nsd/CVE-2026-101341.txt

Detection Methods for CVE-2026-101341

Indicators of Compromise

  • Unexpected crashes or restarts of the nsd process when loading a zone file
  • Zone files containing long sequences of short (<32 byte) quoted text tokens in TXT or other text-bearing RDATA
  • Zone reload events that correlate with abnormal child process spawning from nsd

Detection Strategies

  • Static scanning of zone files prior to ingestion for abnormal token patterns in RDATA
  • Monitor NSD process integrity: unexpected SIGSEGV, SIGABRT, or coredumps during nsd-control reload
  • Audit all provisioning paths that write zone files to the NSD configuration directory

Monitoring Recommendations

  • Enable core dump capture for nsd and forward crash telemetry to a central log pipeline
  • Alert on changes to files under the NSD zones directory from non-authorized identities
  • Track commits and merges in zone file repositories that introduce TXT records with unusual token density

How to Mitigate CVE-2026-101341

Immediate Actions Required

  • Upgrade NSD to the fixed release identified in the NLnet Labs advisory as soon as it is available
  • Restrict write access to zone files and the directories NSD reads from
  • Validate and sanitize zone files generated by provisioning systems before they reach NSD

Patch Information

Refer to the NLnet Labs CVE-2026-101341 advisory for the fixed NSD version and patch details. Apply the vendor-supplied patch on all authoritative NSD instances that ingest zone files from external or operator-controlled sources.

Workarounds

  • Load only zone files that NSD itself has written (for example, AXFR-received secondary zones) until the patch is applied
  • Introduce a pre-ingest linter that rejects RDATA containing suspicious runs of short text tokens
  • Isolate the NSD provisioning path so that only trusted automation can deliver zone files
bash
# Example: restrict permissions on the NSD zones directory
chown -R root:nsd /etc/nsd/zones
chmod 750 /etc/nsd/zones
find /etc/nsd/zones -type f -exec chmod 640 {} \;

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.