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

CVE-2026-101337: NSD Buffer Overflow Vulnerability

CVE-2026-101337 is a buffer overflow vulnerability in NSD DNS server that allows attackers to overwrite the stack with up to 64K of controlled data through malformed base64 tokens in zone files. This article covers technical details, affected versions, impact assessment, 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-101337 Overview

CVE-2026-101337 is a stack-based buffer overflow [CWE-121] in NLnet Labs NSD (Name Server Daemon). The flaw occurs when base64 data in a zone file is split into pieces of three characters or fewer. The token calculation incorrectly produces zero bytes, which lets an attacker overwrite the stack with up to 64 KB of attacker-controlled data. Exploitation requires feeding a crafted zone file directly to NSD, for example through an operator-controlled provisioning system. Zone files written out by NSD itself, such as those for secondary zones, are not affected because NSD does not format them in the vulnerable way.

Critical Impact

An attacker who can supply a zone file to NSD can corrupt the stack with up to 64 KB of controlled data, enabling potential code execution on the authoritative DNS server.

Affected Products

  • NLnet Labs NSD (Name Server Daemon) — specific affected versions listed in the NLnet Labs CVE-2026-101337 Report
  • Deployments that ingest externally supplied zone files through provisioning pipelines
  • Authoritative DNS infrastructure consuming operator-controlled zone data

Discovery Timeline

  • 2026-10-14 - CVE-2026-101337 published to the National Vulnerability Database (NVD)
  • 2026-10-14 - Last updated in NVD database

Technical Details for CVE-2026-101337

Vulnerability Analysis

NSD parses base64-encoded data in zone files, which is commonly used for DNSSEC records such as DNSKEY, RRSIG, and TLSA. The base64 decoder processes input in tokens and converts them into binary output bytes. When the input is split across whitespace or line breaks into fragments of three characters or fewer, the token length calculation returns zero. This zero-byte accounting bypasses the bounds tracking that normally limits the amount of data written to the destination buffer on the stack.

An attacker who controls zone file input can repeatedly supply short base64 fragments. Each fragment still produces decoded output, but the parser believes no bytes were written. The cumulative overflow can reach approximately 64 KB of attacker-controlled bytes written past the end of the fixed stack buffer. This corrupts saved return addresses, frame pointers, and adjacent local variables.

Root Cause

The root cause is incorrect token size accounting in the base64 decoding path. The parser treats fragments of three characters or fewer as producing zero output bytes, even though decoded bytes are still emitted. The missing length update defeats the bounds check that guards the stack buffer, resulting in an unbounded stack write classified under [CWE-121] Stack-based Buffer Overflow.

Attack Vector

Exploitation requires the ability to deliver a malicious zone file to NSD directly. Common delivery paths include operator provisioning systems, zone transfer workflows that stage files on disk before loading, and configuration management tools that push zone content to authoritative servers. Secondary zones populated by NSD itself through AXFR or IXFR are not written in the vulnerable format and do not trigger the bug. The attacker must therefore influence an upstream input channel that supplies raw zone text to NSD.

See the NLnet Labs CVE-2026-101337 Report for the technical write-up and patch details.

Detection Methods for CVE-2026-101337

Indicators of Compromise

  • Zone files containing base64 record data fragmented into runs of three or fewer characters separated by whitespace or line breaks.
  • NSD process crashes, stack smashing protector aborts, or SIGSEGV events during zone load.
  • Unexpected modifications to zone files staged by provisioning systems or configuration management tooling.
  • New or unusual child processes spawned by the nsd daemon following a zone reload.

Detection Strategies

  • Statically scan zone files for abnormally short base64 token sequences prior to loading them into NSD.
  • Alert on NSD daemon crashes or restarts correlated with zone reload operations.
  • Monitor file integrity on zone file directories and provisioning staging paths for unauthorized writes.
  • Review audit logs from provisioning and configuration management systems for untrusted zone content submissions.

Monitoring Recommendations

  • Forward NSD logs, syslog, and crash telemetry to a centralized analytics platform for correlation with zone change events.
  • Track process lineage of the nsd service and alert on any execution of shells or network utilities as children.
  • Baseline normal zone file size and record counts, and flag large deltas introduced by a single commit.

How to Mitigate CVE-2026-101337

Immediate Actions Required

  • Upgrade NSD to the patched release identified in the NLnet Labs CVE-2026-101337 Report.
  • Restrict write access to zone file directories to a minimal set of trusted operators and automation accounts.
  • Audit provisioning pipelines that feed zone files to NSD and require authenticated, reviewed commits.
  • Validate incoming zone content against a schema that normalizes base64 fields before NSD ingests them.

Patch Information

NLnet Labs has published patched NSD versions through its advisory at the NLnet Labs CVE-2026-101337 Report. Apply the fixed release to all authoritative name servers that load zone files from operator or external sources. Restart the nsd service after upgrading and verify the running version.

Workarounds

  • Pre-process zone files with a sanitizer that re-encodes base64 fields as contiguous tokens before passing them to NSD.
  • Reject zone files containing base64 fragments shorter than four characters at the provisioning layer.
  • Isolate NSD on a dedicated host with least-privilege service accounts and seccomp or AppArmor confinement until patching is complete.
bash
# Example pre-ingest check: reject zone files with short base64 fragments
grep -En '([A-Za-z0-9+/]{1,3}[[:space:]]+){2,}[A-Za-z0-9+/]{1,3}' /etc/nsd/zones/*.zone \
  && echo "Suspicious short base64 tokens detected - do not load" \
  || echo "Zone files pass pre-ingest check"

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.