CVE-2019-13951

9.8 CRITICAL

📋 TL;DR

This vulnerability allows remote attackers to execute arbitrary code on gdnsd servers via a stack-based buffer overflow. Attackers can trigger this by sending specially crafted DNS zone data containing a malformed IPv4 address. Systems running vulnerable versions of gdnsd 3.x are affected.

💻 Affected Systems

Products:
  • gdnsd
Versions: 3.x versions before 3.2.1
Operating Systems: Linux, Unix-like systems
Default Config Vulnerable: ⚠️ Yes
Notes: Any configuration using zone data with IPv4 addresses is vulnerable. The vulnerability is in the parsing logic, not dependent on specific features being enabled.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise, allowing attackers to install malware, exfiltrate data, or pivot to other systems.

🟠

Likely Case

Denial of service through service crashes, potentially disrupting DNS resolution for dependent services.

🟢

If Mitigated

Limited impact if proper network segmentation and least privilege principles are implemented, though service disruption remains possible.

🌐 Internet-Facing: HIGH - gdnsd is a DNS server often exposed to external networks, making it directly accessible to attackers.
🏢 Internal Only: MEDIUM - Internal gdnsd instances could still be exploited by compromised internal systems or malicious insiders.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

The vulnerability is in a core parsing function and requires only malformed zone data to trigger. Public proof-of-concept exists in the GitHub issue.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 3.2.1

Vendor Advisory: https://github.com/gdnsd/gdnsd/issues/185

Restart Required: Yes

Instructions:

1. Backup current configuration. 2. Stop gdnsd service. 3. Upgrade to gdnsd 3.2.1 or later using package manager or source compilation. 4. Verify configuration compatibility. 5. Restart gdnsd service.

🔧 Temporary Workarounds

Input Validation Filter

linux

Implement external validation of zone data before it reaches gdnsd to reject malformed IPv4 addresses.

# Use tools like dnslint or custom scripts to validate zone files
# Example: validate-zone-file example.com.zone

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate gdnsd instances from untrusted networks.
  • Deploy intrusion prevention systems (IPS) with rules to detect and block malformed DNS zone data patterns.

🔍 How to Verify

Check if Vulnerable:

Check gdnsd version with 'gdnsd --version' or package manager. If version is 3.x and less than 3.2.1, system is vulnerable.

Check Version:

gdnsd --version

Verify Fix Applied:

After upgrade, run 'gdnsd --version' to confirm version is 3.2.1 or higher, then test DNS functionality.

📡 Detection & Monitoring

Log Indicators:

  • Segmentation fault or crash logs from gdnsd process
  • Unusual zone file modification timestamps
  • Failed zone parsing errors

Network Indicators:

  • Unusually large DNS zone transfer requests
  • Malformed IPv4 addresses in DNS traffic (e.g., more than 15 characters between dots)

SIEM Query:

source="gdnsd.log" AND ("segmentation fault" OR "buffer overflow" OR "SIGSEGV")

🔗 References

📤 Share & Export