CVE-2019-25040
📋 TL;DR
Unbound DNS resolver versions before 1.9.5 contain a vulnerability where specially crafted DNS responses with compressed domain names can trigger an infinite loop in the dname_pkt_copy function. This affects systems running vulnerable Unbound installations as DNS resolvers. The vendor disputes exploitability, stating running installations cannot be remotely or locally exploited.
💻 Affected Systems
- Unbound DNS resolver
📦 What is this software?
Unbound by Nlnetlabs
⚠️ Risk & Real-World Impact
Worst Case
Denial of service causing Unbound process to hang indefinitely, disrupting DNS resolution for dependent systems and services.
Likely Case
Process hangs requiring manual restart, causing temporary DNS resolution failure until service recovery.
If Mitigated
Minimal impact with proper monitoring and restart mechanisms in place.
🎯 Exploit Status
Requires ability to send malicious DNS responses to Unbound resolver. Vendor disputes exploitability of running installations.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 1.9.5 and later
Vendor Advisory: https://nlnetlabs.nl/downloads/unbound/CVE-2019-25040.txt
Restart Required: Yes
Instructions:
1. Backup current configuration. 2. Download Unbound 1.9.5 or later from nlnetlabs.nl. 3. Stop Unbound service. 4. Install new version. 5. Restart Unbound service. 6. Verify service is running and resolving correctly.
🔧 Temporary Workarounds
Restrict DNS sources
linuxConfigure Unbound to only accept DNS queries from trusted sources using access-control settings.
# In unbound.conf: access-control: 192.168.0.0/16 allow
# access-control: 10.0.0.0/8 allow
Implement process monitoring
linuxSet up monitoring to detect and automatically restart Unbound if it becomes unresponsive.
# Example systemd service with restart: Restart=always
# RestartSec=10
🧯 If You Can't Patch
- Implement strict network controls to limit which systems can send DNS responses to Unbound
- Deploy monitoring with automatic restart capabilities for Unbound service
🔍 How to Verify
Check if Vulnerable:
Check Unbound version: unbound -V | grep version. If version is earlier than 1.9.5, system is vulnerable.
Check Version:
unbound -V | grep version
Verify Fix Applied:
After patching, verify version is 1.9.5 or later with: unbound -V | grep version
📡 Detection & Monitoring
Log Indicators:
- Unbound process hanging with high CPU usage
- DNS resolution failures in application logs
- Service restart events in system logs
Network Indicators:
- Increased DNS query timeouts
- DNS resolution failures from clients
SIEM Query:
source="unbound.log" ("error" OR "failed" OR "timeout") AND "dname_pkt_copy"
🔗 References
- https://lists.debian.org/debian-lts-announce/2021/05/msg00007.html
- https://ostif.org/our-audit-of-unbound-dns-by-x41-d-sec-full-results/
- https://security.netapp.com/advisory/ntap-20210507-0007/
- https://lists.debian.org/debian-lts-announce/2021/05/msg00007.html
- https://ostif.org/our-audit-of-unbound-dns-by-x41-d-sec-full-results/
- https://security.netapp.com/advisory/ntap-20210507-0007/