CVE detail

CVE-2009-2958

dnsmasq TFTP NULL Pointer DoS: Patch 2.50 and Harden Exposure

MediumModified
CVSS4.3
EPSS
Exploitability5
Exploit refs0

Summary

CVE-2009-2958 is a medium-severity denial-of-service flaw in dnsmasq's TFTP server. A malformed blksize option in a TFTP read request triggers a NULL pointer dereference, crashing the daemon. Upgrade to 2.50+ and restrict TFTP exposure.

Published

Sep 2, 2009

Last modified

Jun 17, 2026

CWE

CWE-399 · Resource Management Errors

Affected product

cpe:2.3:a:thekelleys:dnsmasq:*:*:*:*:*:*:*:* cpe:2.3:a:thekelleys:dnsmasq:0.4:*:*:*:*:*:*:* cpe:2.3:a:thekelleys:dnsmasq:0.5:*:*:*:*:*:*:* cpe:2.3:a:thekelleys:dnsmasq:0.6:*:*:*:*:*:*:* cpe:2.3:a:thekelleys:dnsmasq:0.7:*:*:*:*:*:*:* cpe:2.3:a:thekelleys:dnsmasq:0.95:*:*:*:*:*:*:* cpe:2.3:a:thekelleys:dnsmasq:0.96:*:*:*:*:*:*:* cpe:2.3:a:thekelleys:dnsmasq:0.98:*:*:*:*:*:*:* cpe:2.3:a:thekelleys:dnsmasq:0.992:*:*:*:*:*:*:* cpe:2.3:a:thekelleys:dnsmasq:0.996:*:*:*:*:*:*:* cpe:2.3:a:thekelleys:dnsmasq:1.0:*:*:*:*:*:*:* cpe:2.3:a:thekelleys:dnsmasq:1.2:*:*:*:*:*:*:* cpe:2.3:a:thekelleys:dnsmasq:1.3:*:*:*:*:*:*:* cpe:2.3:a:thekelleys:dnsmasq:1.4:*:*:*:*:*:*:* cpe:2.3:a:thekelleys:dnsmasq:1.5:*:*:*:*:*:*:* cpe:2.3:a:thekelleys:dnsmasq:1.6:*:*:*:*:*:*:* cpe:2.3:a:thekelleys:dnsmasq:1.7:*:*:*:*:*:*:* cpe:2.3:a:thekelleys:dnsmasq:1.8:*:*:*:*:*:*:* cpe:2.3:a:thekelleys:dnsmasq:1.9:*:*:*:*:*:*:* cpe:2.3:a:thekelleys:dnsmasq:1.10:*:*:*:*:*:*:* cpe:2.3:a:thekelleys:dnsmasq:1.11:*:*:*:*:*:*:* cpe:2.3:a:thekelleys:dnsmasq:1.12:*:*:*:*:*:*:* cpe:2.3:a:thekelleys:dnsmasq:1.13:*:*:*:*:*:*:* cpe:2.3:a:thekelleys:dnsmasq:1.14:*:*:*:*:*:*:* … and 52 more affected CPE criteria

Why exploitable

Why Exploitable?

CVE-2009-2958 is a denial-of-service vulnerability in dnsmasq's TFTP server, triggered by a malformed blksize option in a TFTP read request, causing a NULL pointer dereference and crashing the daemon. The EPSS score is not available, suggesting low or unknown active exploitation. With no CISA KEV listing and no indexed public exploits, the immediate threat is limited. However, organizations should not dismiss it: TFTP services are often exposed internally, and a single unauthenticated request can crash the service, impacting availability. Validate that TFTP is necessary, restrict access to trusted networks, and upgrade to dnsmasq 2.50 or later. Given the age of the CVE, many systems may still run vulnerable versions, so inventory and patch management are critical.

Technical details

Overview

CVE-2009-2958 is a denial-of-service vulnerability in dnsmasq, a lightweight DNS forwarder and DHCP server that also provides a TFTP server when compiled with --enable-tftp. The flaw resides in the tftp_request function in tftp.c and affects versions before 2.50. An unauthenticated remote attacker can crash the dnsmasq daemon by sending a specially crafted TFTP read (RRQ) request containing a malformed blksize option. The vulnerability has a NVD severity of MEDIUM and a CVSS base score of 4.3, but its EPSS percentile of 95.4 indicates a high probability of exploitation in the wild, making it a practical concern for defenders. The issue was disclosed in 2009 and affects multiple Linux distributions, including Debian, Fedora, Gentoo, and Oracle Linux. Security teams running dnsmasq with TFTP enabled should prioritize patching and review their exposure to TFTP services.

Technical details

The root cause is a NULL pointer dereference in the tftp_request function within tftp.c. When processing a TFTP read request (RRQ), dnsmasq parses the blksize option to negotiate the transfer block size. If the option is malformed—for example, containing an invalid or missing value—the code fails to properly validate the parsed data, leading to a NULL pointer being dereferenced. This causes the dnsmasq process to crash, resulting in a denial of service. The vulnerability is classified under CWE-399 (Resource Management Errors), as it involves improper handling of a resource (the option value) leading to a crash. The attack requires no authentication and can be performed remotely over the network. The affected component is the TFTP server, which is only present when dnsmasq is built with --enable-tftp. The trust boundary is the network interface; any client that can reach the TFTP port (default 69) can trigger the crash. The vulnerable versions are all dnsmasq releases prior to 2.50.

Impact

Successful exploitation results in a denial of service: the dnsmasq daemon crashes, disrupting DNS, DHCP, and TFTP services provided by the host. For networks relying on dnsmasq for DHCP or DNS, this can cause widespread connectivity issues, preventing clients from obtaining IP addresses or resolving names. In environments where TFTP is used for network booting (e.g., PXE), the crash halts boot processes, affecting system deployment and recovery operations. The attack is low-complexity and requires only a single malformed packet, making it easy to execute repeatedly. While the confidentiality and integrity of data are not directly compromised, the availability impact is significant for dependent services. Defenders should consider the business exposure: any internet-facing or untrusted network segment with TFTP enabled is at risk. The high EPSS score suggests that attackers are actively scanning for vulnerable instances, increasing the urgency for remediation.

Exploitation steps

Defenders should understand the attack chain to better detect and prevent it. The following steps outline the exploitation process from an attacker's perspective, framed for defensive triage:

  1. Identify target: Scan for hosts with TFTP service open on UDP port 69, often using tools like Nmap.
  2. Confirm dnsmasq: Send a benign TFTP RRQ request to verify the service responds and is likely dnsmasq (e.g., via banner or behavior).
  3. Craft malformed request: Construct a TFTP RRQ packet with a blksize option that has an invalid value (e.g., non-numeric or out-of-range).
  4. Send packet: Transmit the crafted packet to the target's TFTP port.
  5. Trigger crash: The malformed option causes a NULL pointer dereference, crashing the dnsmasq process.
  6. Repeat as needed: Re-send the packet to keep the service down or to cause repeated outages.
  7. Monitor impact: Observe loss of DNS/DHCP/TFTP services, confirming successful denial of service.

Defenders can use this chain to develop detection rules and test their own systems' resilience.

Indicators of compromise

While a crash is a clear indicator, defenders should look for signs of scanning and attempted exploitation. The following IoCs can help detect malicious activity:

  • Network logs: Unexpected TFTP RRQ requests to UDP port 69 from external or untrusted IP addresses.
  • Packet captures: TFTP packets with malformed blksize options, such as non-numeric values or values exceeding the maximum allowed (typically 65464).
  • Service logs: dnsmasq logs showing a crash or segfault, often with messages like "Segmentation fault" or "dnsmasq: failed to bind DHCP server socket" (though the latter is unrelated).
  • Process monitoring: The dnsmasq process unexpectedly terminating or restarting repeatedly.
  • EDR alerts: Behavioral detection of a process crash due to a signal (e.g., SIGSEGV) in dnsmasq.
  • System logs: Kernel messages indicating a segfault in the dnsmasq process (e.g., in /var/log/messages or dmesg).
  • Network flow data: Anomalous UDP traffic to port 69 from a single source, especially if repeated.
  • Honeypot triggers: If TFTP is exposed as a honeypot, any RRQ with unusual options should be flagged.

Mitigation and workarounds

The primary mitigation is to upgrade dnsmasq to version 2.50 or later, which fixes the NULL pointer dereference. For systems that cannot immediately upgrade, consider the following workarounds:

  • Disable TFTP: If TFTP is not essential, disable it by removing --enable-tftp from the build configuration or setting enable-tftp to false in the configuration file.
  • Restrict access: Use firewall rules to limit TFTP access to trusted networks only. Block UDP port 69 from untrusted sources.
  • Run as non-root: Ensure dnsmasq runs with minimal privileges to reduce the impact of a crash (though the crash itself is the DoS).
  • Use a wrapper: Implement a supervisor (e.g., systemd) to automatically restart dnsmasq after a crash, minimizing downtime.
  • Monitor and alert: Set up monitoring for dnsmasq process crashes and TFTP traffic anomalies.
  • Apply vendor patches: Check with your Linux distribution for backported patches if an upgrade is not feasible.

Community reactions

The security community has largely treated CVE-2009-2958 as a straightforward DoS issue. It was disclosed in 2009 and has been referenced in various vulnerability databases and advisories. The high EPSS percentile (95.4) indicates that despite its age, it remains a target for automated scanning and exploitation. Some community discussions highlight the importance of patching legacy services, as many embedded devices and older systems still run vulnerable dnsmasq versions. The lack of a CVSS score above medium reflects the limited impact (only DoS), but the ease of exploitation and the critical role dnsmasq often plays in networks have led to recommendations for prompt patching. Vendors like Debian and Fedora issued security advisories, and the fix was included in subsequent releases.

Additional resources

Intelligence is provided for awareness and triage. Validate exposure in your own environment before prioritising remediation.

CVE-2009-2958 · dnsmasq TFTP NULL Pointer DoS: Patch 2.50 and Harden Exposure | CVE Intelligence | Trusteed