CVE detail
CVE-2012-3411
Dnsmasq Traffic Amplification via Prohibited Interface Replies
Search another CVE
Summary
CVE-2012-3411 is a medium-severity input validation flaw in dnsmasq before 2.63test1. Under specific libvirt configurations, the service answers DNS queries from interfaces it should ignore, enabling remote spoofed queries to amplify traffic and cause denial of service.
Technical details
Overview
CVE-2012-3411 is a vulnerability in dnsmasq, a lightweight DNS forwarder and DHCP server widely used in Linux environments, particularly in virtualization and container setups. The flaw exists in versions prior to 2.63test1 and is triggered when dnsmasq is used with certain libvirt configurations. In such configurations, dnsmasq incorrectly replies to DNS requests arriving on interfaces that are supposed to be prohibited or ignored. This behavior allows remote attackers to send spoofed DNS queries, leading to traffic amplification and potential denial of service (DoS).
The vulnerability has been assigned a NVD severity of MEDIUM with a CVSS base score of 5.0. Its EPSS percentile is 91.6, indicating a high likelihood of exploitation in the wild. Affected technologies include dnsmasq itself, as well as Linux distributions such as Debian, Red Hat, Amazon Linux, CentOS, Gentoo, and Oracle Linux. The issue was disclosed in 2012, but its relevance persists in environments that have not applied patches or that run older configurations.
Security teams managing virtualized infrastructures, especially those using libvirt for VM management, should prioritize assessing their dnsmasq versions and configurations. The vulnerability is particularly concerning for environments where dnsmasq is exposed to untrusted networks, as the amplification vector can be abused to flood targets with DNS traffic.
Technical details
The root cause of CVE-2012-3411 is improper input validation (CWE-20) in dnsmasq's handling of DNS queries. Specifically, dnsmasq fails to enforce interface restrictions when replying to DNS requests. In standard operation, dnsmasq can be configured to listen only on specific interfaces or to ignore queries from certain interfaces. However, due to a logic flaw, when used with certain libvirt configurations, dnsmasq processes and responds to queries from interfaces that should be blocked.
The vulnerable component is the DNS forwarder module within dnsmasq. The issue occurs because the code does not adequately validate the source interface of incoming DNS packets against the configured allow/deny lists. This allows an attacker to send a DNS query with a spoofed source IP address, and dnsmasq will respond, thereby amplifying traffic because the response is typically larger than the query.
Affected version ranges include all dnsmasq versions before 2.63test1. The attack prerequisites are minimal: the attacker must be able to send DNS queries to the dnsmasq instance, and the instance must be running with a libvirt configuration that triggers the flaw. The trust boundary is the network interface configuration; dnsmasq trusts that the interface filtering is correctly applied, but the flaw breaks that trust.
The weakness is categorized as CWE-20, Improper Input Validation, because the software does not properly validate the source interface of the DNS query before processing it.
Impact
Successful exploitation of CVE-2012-3411 can lead to a denial of service condition through traffic amplification. An attacker can send a small number of spoofed DNS queries to the vulnerable dnsmasq instance, which then responds with larger DNS responses, flooding the target (the spoofed source IP) with unwanted traffic. This can saturate the target's network bandwidth, causing service disruption.
The impact is primarily on availability, as the goal is to degrade or deny service to the victim. There is minimal confidentiality or integrity impact, as the attacker does not gain access to data or modify system state. However, the amplification can be used as part of a larger DDoS campaign, making the vulnerable dnsmasq an unwitting participant in attacks against third parties.
For defenders, the business exposure includes potential downtime of services hosted on the target, reputational damage, and the risk of being implicated in DDoS attacks. In virtualized environments, a compromised dnsmasq could also affect DNS resolution for multiple VMs, leading to broader operational impact.
Exploitation steps
Defenders should understand the potential exploitation chain to better detect and mitigate attacks. The following steps outline how an attacker might exploit this vulnerability, framed for defensive triage:
- Identify vulnerable dnsmasq instances: The attacker scans for dnsmasq services running on port 53, particularly in environments using libvirt.
- Determine if the instance is vulnerable: The attacker sends a test DNS query from a prohibited interface (or spoofs the source) to see if a response is received.
- Craft spoofed DNS queries: The attacker crafts DNS queries with a spoofed source IP address, targeting the victim's IP as the source.
- Send queries to dnsmasq: The attacker sends a stream of these spoofed queries to the vulnerable dnsmasq server.
- Amplification: dnsmasq responds to each query, sending DNS responses to the spoofed source IP (the victim), causing traffic amplification.
- Scale up: The attacker repeats the process with multiple queries or distributed sources to increase the volume of traffic directed at the victim.
- Monitor for impact: The attacker observes the victim's service degradation or outage.
Defenders should monitor for unusual DNS query patterns, especially from unexpected interfaces, and investigate any spikes in outbound DNS traffic from dnsmasq servers.
Indicators of compromise
To detect potential exploitation of CVE-2012-3411, security teams should look for the following indicators:
- Unusual DNS query sources: DNS queries arriving on interfaces that are configured as prohibited or should be ignored.
- High volume of DNS responses: A sudden increase in outbound DNS traffic from dnsmasq servers, especially to a single destination IP.
- Spoofed source IPs: DNS queries with source IP addresses that do not match the expected network range for the interface.
- Log entries: dnsmasq logs may show queries from unexpected interfaces or repeated queries to the same domain from different sources.
- Network traffic anomalies: Large DNS response packets (e.g., ANY or TXT queries) being sent to a single IP, indicating amplification.
- EDR alerts: Unusual network connections from the dnsmasq process to external IPs on port 53.
- Resource exhaustion: High CPU or memory usage on the dnsmasq host due to processing a large number of queries.
- Libvirt configuration changes: Unauthorized changes to libvirt network configurations that might enable the vulnerable behavior.
Mitigation and workarounds
The primary mitigation is to upgrade dnsmasq to version 2.63test1 or later, which fixes the interface validation flaw. Administrators should check their Linux distribution's package repository for patched versions and apply updates promptly.
For environments where immediate patching is not possible, consider the following workarounds:
- Review libvirt configurations: Ensure that dnsmasq is not listening on interfaces that should be prohibited. Adjust libvirt network settings to restrict dnsmasq to trusted interfaces only.
- Firewall rules: Implement firewall rules to block DNS traffic from untrusted interfaces or source IPs.
- Rate limiting: Configure rate limiting on DNS responses to mitigate amplification impact.
- Disable recursion: If dnsmasq is not required to perform recursive queries, disable recursion to reduce the amplification factor.
- Network segmentation: Isolate dnsmasq instances from untrusted networks to limit exposure.
Vendor guidance from Red Hat, Debian, and other affected distributions should be followed for specific patch availability and recommended configurations.
Community reactions
The security community has discussed CVE-2012-3411 in the context of DNS amplification attacks, which were a common DDoS vector in the early 2010s. Researchers highlighted the importance of proper interface validation in DNS servers to prevent such abuse. Vendors like Red Hat and Debian released advisories and patches, and the issue was noted in security mailing lists and vulnerability databases.
While the vulnerability is old, its EPSS percentile of 91.6 suggests that attackers may still attempt to exploit unpatched systems. Community discussions emphasize the need for continuous patch management and configuration reviews in virtualized environments.
Additional resources
References
- http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=683372
- http://rhn.redhat.com/errata/RHSA-2013-0276.html
- http://rhn.redhat.com/errata/RHSA-2013-0277.html
- http://rhn.redhat.com/errata/RHSA-2013-0579.html
- http://thekelleys.org.uk/gitweb/?p=dnsmasq.git%3Ba=commitdiff%3Bh=2f38141f434e23292f84cefc33e8de76fb856147
- http://thekelleys.org.uk/gitweb/?p=dnsmasq.git%3Ba=commitdiff%3Bh=54dd393f3938fc0c19088fbd319b95e37d81a2b0
- http://www.mandriva.com/security/advisories?name=MDVSA-2013:072
- http://www.openwall.com/lists/oss-security/2012/07/12/5
- http://www.securityfocus.com/bid/54353
- http://www.thekelleys.org.uk/dnsmasq/CHANGELOG
- https://bugzilla.redhat.com/show_bug.cgi?id=833033
- http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=683372
- http://rhn.redhat.com/errata/RHSA-2013-0276.html
- http://rhn.redhat.com/errata/RHSA-2013-0277.html
- http://rhn.redhat.com/errata/RHSA-2013-0579.html
- http://thekelleys.org.uk/gitweb/?p=dnsmasq.git%3Ba=commitdiff%3Bh=2f38141f434e23292f84cefc33e8de76fb856147
- http://thekelleys.org.uk/gitweb/?p=dnsmasq.git%3Ba=commitdiff%3Bh=54dd393f3938fc0c19088fbd319b95e37d81a2b0
- http://www.mandriva.com/security/advisories?name=MDVSA-2013:072
- http://www.openwall.com/lists/oss-security/2012/07/12/5
- http://www.securityfocus.com/bid/54353
- http://www.thekelleys.org.uk/dnsmasq/CHANGELOG
- https://bugzilla.redhat.com/show_bug.cgi?id=833033
Intelligence is provided for awareness and triage. Validate exposure in your own environment before prioritising remediation.