Vulnerabilities > CVE-2009-2957 - Improper Restriction of Operations within the Bounds of a Memory Buffer vulnerability in Thekelleys Dnsmasq

047910
CVSS 0.0 - NONE
Attack vector
UNKNOWN
Attack complexity
UNKNOWN
Privileges required
UNKNOWN
Confidentiality impact
UNKNOWN
Integrity impact
UNKNOWN
Availability impact
UNKNOWN
thekelleys
CWE-119
nessus
exploit available

Summary

Heap-based buffer overflow in the tftp_request function in tftp.c in dnsmasq before 2.50, when --enable-tftp is used, might allow remote attackers to execute arbitrary code via a long filename in a TFTP packet, as demonstrated by a read (aka RRQ) request.

Vulnerable Configurations

Part Description Count
Application
Thekelleys
77

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Buffer Overflow via Environment Variables
    This attack pattern involves causing a buffer overflow through manipulation of environment variables. Once the attacker finds that they can modify an environment variable, they may try to overflow associated buffers. This attack leverages implicit trust often placed in environment variables.
  • Overflow Buffers
    Buffer Overflow attacks target improper or missing bounds checking on buffer operations, typically triggered by input injected by an attacker. As a consequence, an attacker is able to write past the boundaries of allocated buffer regions in memory, causing a program crash or potentially redirection of execution as per the attackers' choice.
  • Client-side Injection-induced Buffer Overflow
    This type of attack exploits a buffer overflow vulnerability in targeted client software through injection of malicious content from a custom-built hostile service.
  • Filter Failure through Buffer Overflow
    In this attack, the idea is to cause an active filter to fail by causing an oversized transaction. An attacker may try to feed overly long input strings to the program in an attempt to overwhelm the filter (by causing a buffer overflow) and hoping that the filter does not fail securely (i.e. the user input is let into the system unfiltered).
  • MIME Conversion
    An attacker exploits a weakness in the MIME conversion routine to cause a buffer overflow and gain control over the mail server machine. The MIME system is designed to allow various different information formats to be interpreted and sent via e-mail. Attack points exist when data are converted to MIME compatible format and back.

Exploit-Db

descriptionDnsmasq < 2.50 Heap Overflow & Null pointer Dereference Vulns. CVE-2009-2957,CVE-2009-2958. Dos exploit for windows platform
idEDB-ID:9617
last seen2016-02-01
modified2009-09-09
published2009-09-09
reporterCore Security
sourcehttps://www.exploit-db.com/download/9617/
titleDnsmasq < 2.50 - Heap Overflow & Null pointer Dereference Vulns

Nessus

  • NASL familyOracleVM Local Security Checks
    NASL idORACLEVM_OVMSA-2009-0022.NASL
    descriptionThe remote OracleVM system is missing necessary patches to address critical security updates : CVE-2009-2957 Heap-based buffer overflow in the tftp_request function in tftp.c in dnsmasq before 2.50, when --enable-tftp is used, might allow remote attackers to execute arbitrary code via a long filename in a TFTP packet, as demonstrated by a read (aka RRQ) request. CVE-2009-2958 The tftp_request function in tftp.c in dnsmasq before 2.50, when --enable-tftp is used, allows remote attackers to cause a denial of service (NULL pointer dereference and daemon crash) via a TFTP read (aka RRQ) request with a malformed blksize option. - problems with strings when enabling tftp (CVE-2009-2957, CVE-2009-2957) - Resolves: rhbg#519021 - update to new upstream version - fixes for CVE-2008-1447/CERT VU#800113 - Resolves: rhbz#454869
    last seen2020-06-01
    modified2020-06-02
    plugin id79464
    published2014-11-26
    reporterThis script is Copyright (C) 2014-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/79464
    titleOracleVM 2.1 : dnsmasq (OVMSA-2009-0022)
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The package checks in this plugin were extracted from OracleVM
    # Security Advisory OVMSA-2009-0022.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(79464);
      script_version("1.24");
      script_cvs_date("Date: 2019/10/25 13:36:06");
    
      script_cve_id("CVE-2008-1447", "CVE-2009-2957", "CVE-2009-2958");
      script_bugtraq_id(30131, 36120);
      script_xref(name:"IAVA", value:"2008-A-0045");
    
      script_name(english:"OracleVM 2.1 : dnsmasq (OVMSA-2009-0022)");
      script_summary(english:"Checks the RPM output for the updated package.");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote OracleVM host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "The remote OracleVM system is missing necessary patches to address
    critical security updates :
    
    CVE-2009-2957 Heap-based buffer overflow in the tftp_request function
    in tftp.c in dnsmasq before 2.50, when --enable-tftp is used, might
    allow remote attackers to execute arbitrary code via a long filename
    in a TFTP packet, as demonstrated by a read (aka RRQ) request.
    CVE-2009-2958 The tftp_request function in tftp.c in dnsmasq before
    2.50, when 
    
    --enable-tftp is used, allows remote attackers to cause a denial of
    service (NULL pointer dereference and daemon crash) via a TFTP read
    (aka RRQ) request with a malformed blksize option.
    
      - problems with strings when enabling tftp (CVE-2009-2957,
        CVE-2009-2957)
    
      - Resolves: rhbg#519021
    
      - update to new upstream version
    
      - fixes for CVE-2008-1447/CERT VU#800113
    
      - Resolves: rhbz#454869"
      );
      # https://oss.oracle.com/pipermail/oraclevm-errata/2009-September/000032.html
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?e4bbb022"
      );
      script_set_attribute(
        attribute:"solution", 
        value:"Update the affected dnsmasq package."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:P/I:P/A:P");
      script_set_cvss_temporal_vector("CVSS2#E:POC/RL:OF/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"true");
      script_cwe_id(119, 399);
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:oracle:vm:dnsmasq");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:oracle:vm_server:2.1");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2008/07/08");
      script_set_attribute(attribute:"patch_publication_date", value:"2009/09/08");
      script_set_attribute(attribute:"plugin_publication_date", value:"2014/11/26");
      script_set_attribute(attribute:"generated_plugin", value:"current");
      script_set_attribute(attribute:"stig_severity", value:"I");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2014-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"OracleVM Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/OracleVM/release", "Host/OracleVM/rpm-list");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/OracleVM/release");
    if (isnull(release) || "OVS" >!< release) audit(AUDIT_OS_NOT, "OracleVM");
    if (! preg(pattern:"^OVS" + "2\.1" + "(\.[0-9]|$)", string:release)) audit(AUDIT_OS_NOT, "OracleVM 2.1", "OracleVM " + release);
    if (!get_kb_item("Host/OracleVM/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if ("x86_64" >!< cpu && cpu !~ "^i[3-6]86$") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "OracleVM", cpu);
    
    flag = 0;
    if (rpm_check(release:"OVS2.1", reference:"dnsmasq-2.45-1.1.el5_3")) flag++;
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:rpm_report_get());
      else security_warning(0);
      exit(0);
    }
    else
    {
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "dnsmasq");
    }
    
  • NASL familyGentoo Local Security Checks
    NASL idGENTOO_GLSA-200909-19.NASL
    descriptionThe remote host is affected by the vulnerability described in GLSA-200909-19 (Dnsmasq: Multiple vulnerabilities) Multiple vulnerabilities have been reported in the TFTP functionality included in Dnsmasq: Pablo Jorge and Alberto Solino discovered a heap-based buffer overflow (CVE-2009-2957). An anonymous researcher reported a NULL pointer reference (CVE-2009-2958). Impact : A remote attacker in the local network could exploit these vulnerabilities by sending specially crafted TFTP requests to a machine running Dnsmasq, possibly resulting in the remote execution of arbitrary code with the privileges of the user running the daemon, or a Denial of Service. NOTE: The TFTP server is not enabled by default. Workaround : You can disable the TFTP server either at buildtime by not enabling the
    last seen2020-06-01
    modified2020-06-02
    plugin id41023
    published2009-09-21
    reporterThis script is Copyright (C) 2009-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/41023
    titleGLSA-200909-19 : Dnsmasq: Multiple vulnerabilities
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were
    # extracted from Gentoo Linux Security Advisory GLSA 200909-19.
    #
    # The advisory text is Copyright (C) 2001-2016 Gentoo Foundation, Inc.
    # and licensed under the Creative Commons - Attribution / Share Alike 
    # license. See http://creativecommons.org/licenses/by-sa/3.0/
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(41023);
      script_version("1.14");
      script_cvs_date("Date: 2019/08/02 13:32:45");
    
      script_cve_id("CVE-2009-2957", "CVE-2009-2958");
      script_bugtraq_id(36120);
      script_xref(name:"GLSA", value:"200909-19");
    
      script_name(english:"GLSA-200909-19 : Dnsmasq: Multiple vulnerabilities");
      script_summary(english:"Checks for updated package(s) in /var/db/pkg");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:
    "The remote Gentoo host is missing one or more security-related
    patches."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "The remote host is affected by the vulnerability described in GLSA-200909-19
    (Dnsmasq: Multiple vulnerabilities)
    
        Multiple vulnerabilities have been reported in the TFTP functionality
        included in Dnsmasq:
        Pablo Jorge and Alberto Solino
        discovered a heap-based buffer overflow (CVE-2009-2957).
        An
        anonymous researcher reported a NULL pointer reference
        (CVE-2009-2958).
      
    Impact :
    
        A remote attacker in the local network could exploit these
        vulnerabilities by sending specially crafted TFTP requests to a machine
        running Dnsmasq, possibly resulting in the remote execution of
        arbitrary code with the privileges of the user running the daemon, or a
        Denial of Service. NOTE: The TFTP server is not enabled by default.
      
    Workaround :
    
        You can disable the TFTP server either at buildtime by not enabling the
        'tftp' USE flag, or at runtime. Make sure '--enable-tftp' is not set in
        the DNSMASQ_OPTS variable in the /etc/conf.d/dnsmasq file and
        'enable-tftp' is not set in /etc/dnsmasq.conf, either of which would
        enable TFTP support if it is compiled in."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://security.gentoo.org/glsa/200909-19"
      );
      script_set_attribute(
        attribute:"solution", 
        value:
    "All Dnsmasq users should upgrade to the latest version:
        # emerge --sync
        # emerge --ask --oneshot --verbose '>=net-dns/dnsmasq-2.5.0'"
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:P/I:P/A:P");
      script_set_cvss_temporal_vector("CVSS2#E:POC/RL:OF/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"true");
      script_cwe_id(119, 399);
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:gentoo:linux:dnsmasq");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:gentoo:linux");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2009/09/20");
      script_set_attribute(attribute:"plugin_publication_date", value:"2009/09/21");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2009-2019 Tenable Network Security, Inc.");
      script_family(english:"Gentoo Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/Gentoo/release", "Host/Gentoo/qpkg-list");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("qpkg.inc");
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    if (!get_kb_item("Host/Gentoo/release")) audit(AUDIT_OS_NOT, "Gentoo");
    if (!get_kb_item("Host/Gentoo/qpkg-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    
    flag = 0;
    
    if (qpkg_check(package:"net-dns/dnsmasq", unaffected:make_list("ge 2.5.0"), vulnerable:make_list("lt 2.5.0"))) flag++;
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:qpkg_report_get());
      else security_warning(0);
      exit(0);
    }
    else
    {
      tested = qpkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "Dnsmasq");
    }
    
  • NASL familyFedora Local Security Checks
    NASL idFEDORA_2009-10285.NASL
    descriptionThis update fixes two security issues with dnsmasq
    last seen2020-06-01
    modified2020-06-02
    plugin id42123
    published2009-10-15
    reporterThis script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/42123
    titleFedora 11 : dnsmasq-2.46-3.fc11 (2009-10285)
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from Fedora Security Advisory 2009-10285.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(42123);
      script_version("1.15");
      script_cvs_date("Date: 2019/08/02 13:32:28");
    
      script_cve_id("CVE-2009-2957", "CVE-2009-2958");
      script_bugtraq_id(36120);
      script_xref(name:"FEDORA", value:"2009-10285");
    
      script_name(english:"Fedora 11 : dnsmasq-2.46-3.fc11 (2009-10285)");
      script_summary(english:"Checks rpm output for the updated package.");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Fedora host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "This update fixes two security issues with dnsmasq's tftp server:
    http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-2957
    http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-2958
    
    Note that Tenable Network Security has extracted the preceding
    description block directly from the Fedora security advisory. Tenable
    has attempted to automatically clean and format it as much as possible
    without introducing additional issues."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.redhat.com/show_bug.cgi?id=519020"
      );
      # https://lists.fedoraproject.org/pipermail/package-announce/2009-October/029959.html
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?50a218e0"
      );
      script_set_attribute(
        attribute:"solution", 
        value:"Update the affected dnsmasq package."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:P/I:P/A:P");
      script_set_cvss_temporal_vector("CVSS2#E:POC/RL:OF/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"true");
      script_cwe_id(119, 399);
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fedoraproject:fedora:dnsmasq");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:fedoraproject:fedora:11");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2009/10/06");
      script_set_attribute(attribute:"plugin_publication_date", value:"2009/10/15");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"Fedora Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/RedHat/release", "Host/RedHat/rpm-list");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/RedHat/release");
    if (isnull(release) || "Fedora" >!< release) audit(AUDIT_OS_NOT, "Fedora");
    os_ver = eregmatch(pattern: "Fedora.*release ([0-9]+)", string:release);
    if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "Fedora");
    os_ver = os_ver[1];
    if (! ereg(pattern:"^11([^0-9]|$)", string:os_ver)) audit(AUDIT_OS_NOT, "Fedora 11.x", "Fedora " + os_ver);
    
    if (!get_kb_item("Host/RedHat/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if ("x86_64" >!< cpu && cpu !~ "^i[3-6]86$") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "Fedora", cpu);
    
    flag = 0;
    if (rpm_check(release:"FC11", reference:"dnsmasq-2.46-3.fc11")) flag++;
    
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:rpm_report_get());
      else security_warning(0);
      exit(0);
    }
    else
    {
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "dnsmasq");
    }
    
  • NASL familyDNS
    NASL idDNSMASQ_MULTIPLE_TFTP_FLAWS.NASL
    descriptionThe remote host is running dnsmasq, a DNS and TFTP server. The version of dnsmasq installed on the remote host reports itself as lower than 2.50. Such versions include a TFTP server that is reportedly affected by a number of issues: - A remote heap-overflow vulnerability exists because the software fails to properly bounds-check user-supplied input before copying it into an insufficiently-sized memory buffer. (CVE-2009-2957) - A malformed TFTP packet can crash dnsmasq with a NULL pointer dereference. (CVE-2009-2958)
    last seen2020-06-01
    modified2020-06-02
    plugin id40875
    published2009-09-04
    reporterThis script is Copyright (C) 2009-2018 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/40875
    titlednsmasq < 2.50 Multiple Remote TFTP Vulnerabilities
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include( 'compat.inc' );
    
    if(description)
    {
      script_id(40875);
      script_version("1.14");
    
      script_cve_id("CVE-2009-2957", "CVE-2009-2958");
      script_bugtraq_id(36120, 36121);
    
      script_name(english:"dnsmasq < 2.50 Multiple Remote TFTP Vulnerabilities");
      script_summary(english: "Checks the version of dnsmasq");
    
      script_set_attribute(
        attribute:'synopsis',
        value:'The remote TFTP service is affected by multiple vulnerabilities.'
      );
    
      script_set_attribute(
        attribute:'description',
        value:'The remote host is running dnsmasq, a DNS and TFTP server. 
    
    The version of dnsmasq installed on the remote host reports itself as
    lower than 2.50.  Such versions include a TFTP server that is
    reportedly affected by a number of issues:
    
      - A remote heap-overflow vulnerability exists because the
        software fails to properly bounds-check user-supplied 
        input before copying it into an insufficiently-sized 
        memory buffer. (CVE-2009-2957)
    
      - A malformed TFTP packet can crash dnsmasq with a NULL
        pointer dereference. (CVE-2009-2958)'
      );
    
      script_set_attribute(
        attribute:'see_also',
        value:'http://www.coresecurity.com/content/dnsmasq-vulnerabilities'
      );
      script_set_attribute(
        attribute:'see_also',
        value:'https://seclists.org/fulldisclosure/2009/Aug/450'
      );
      # https://web.archive.org/web/20090901005927/http://www.thekelleys.org.uk/dnsmasq/CHANGELOG
      script_set_attribute(
        attribute:'see_also',
        value:'http://www.nessus.org/u?a0dc0215'
      );
       # http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2009q3/003253.html
      script_set_attribute(
        attribute:'see_also',
        value:'http://www.nessus.org/u?7052e1ae'
      );
      script_set_attribute(
        attribute:'solution',
        value:'Upgrade to dnsmasq 2.50 or later.'
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:C");
      script_set_cvss_temporal_vector("CVSS2#E:POC/RL:OF/RC:C");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H");
      script_set_cvss3_temporal_vector("CVSS:3.0/E:P/RL:O/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"true");
      script_cwe_id(119, 399);
    
      script_set_attribute( attribute:'vuln_publication_date', value:'2009/08/31' );
      script_set_attribute( attribute:'patch_publication_date', value:'2009/08/31' );
      script_set_attribute( attribute:'plugin_publication_date', value:'2009/09/04' );
    
     script_cvs_date("Date: 2018/11/15 20:50:21");
      script_set_attribute(attribute:"plugin_type", value:"remote");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:thekelleys:dnsmasq");
      script_set_attribute(attribute:"potential_vulnerability", value:"true");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2009-2018 Tenable Network Security, Inc.");
      script_family(english: "DNS");
    
      script_dependencie("dns_version.nasl", "tftpd_detect.nasl");
      script_require_keys("dns_server/version", "Settings/ParanoidReport");
      script_require_ports("Services/dns", 53, "Services/udp/tftp");
     
      exit(0);
    }
    
    include("audit.inc");
    include("global_settings.inc");
    include("misc_func.inc");
    
    app_name = "dnsmasq";
    
    get_kb_item_or_exit("Services/udp/dns");
    port = get_kb_item_or_exit( "Services/udp/tftp" );
    
    if (report_paranoia < 2) audit(AUDIT_PARANOID);
    
    # dnsmasq replies to BIND.VERSION
    version = get_kb_item_or_exit("dns_server/version");
    version = tolower(version);
    display_version = version;
    
    if (version !~ "dnsmasq-(v)?")
      audit(AUDIT_NOT_LISTEN, app_name, port);
    
    version = ereg_replace(pattern:"^dnsmasq-(v)?(.*)$", replace:"\2", string:version);
    
    if (version == '2')
      audit(AUDIT_VER_NOT_GRANULAR, app_name, port, display_version);
    
    if (version =~ "^([01]\.|2\.([0-9]|[1-4][0-9])$)")
    {
      report = '\n' +
        '\n  Installed version : ' + display_version +
        '\n  Fixed version     : dnsmasq-2.50' +
        '\n';
      security_report_v4(port:port, proto:"udp", severity:SECURITY_HOLE, extra:report);
    }
    else audit(AUDIT_LISTEN_NOT_VULN, app_name, port, display_version, 'udp');
    
  • NASL familyScientific Linux Local Security Checks
    NASL idSL_20090831_DNSMASQ_ON_SL5_X.NASL
    descriptionCVE-2009-2957, CVE-2009-2958 dnsmasq: multiple vulnerabilities in TFTP server Core Security Technologies discovered a heap overflow flaw in dnsmasq when the TFTP service is enabled (the
    last seen2020-06-01
    modified2020-06-02
    plugin id60649
    published2012-08-01
    reporterThis script is Copyright (C) 2012-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/60649
    titleScientific Linux Security Update : dnsmasq on SL5.x i386/x86_64
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text is (C) Scientific Linux.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(60649);
      script_version("1.5");
      script_cvs_date("Date: 2019/10/25 13:36:18");
    
      script_cve_id("CVE-2009-2957", "CVE-2009-2958");
    
      script_name(english:"Scientific Linux Security Update : dnsmasq on SL5.x i386/x86_64");
      script_summary(english:"Checks rpm output for the updated package");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Scientific Linux host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "CVE-2009-2957, CVE-2009-2958 dnsmasq: multiple vulnerabilities in TFTP
    server
    
    Core Security Technologies discovered a heap overflow flaw in dnsmasq
    when the TFTP service is enabled (the '--enable-tftp' command line
    option, or by enabling 'enable-tftp' in '/etc/dnsmasq.conf'). If the
    configured tftp-root is sufficiently long, and a remote user sends a
    request that sends a long file name, dnsmasq could crash or, possibly,
    execute arbitrary code with the privileges of the dnsmasq service
    (usually the unprivileged 'nobody' user). (CVE-2009-2957)
    
    A NULL pointer dereference flaw was discovered in dnsmasq when the
    TFTP service is enabled. This flaw could allow a malicious TFTP client
    to crash the dnsmasq service. (CVE-2009-2958)
    
    Note: The default tftp-root is '/var/ftpd', which is short enough to
    make it difficult to exploit the CVE-2009-2957 issue; if a longer
    directory name is used, arbitrary code execution may be possible. As
    well, the dnsmasq package distributed by Red Hat does not have TFTP
    support enabled by default.
    
    After installing the updated package, the dnsmasq service must be
    restarted for the update to take effect."
      );
      # https://listserv.fnal.gov/scripts/wa.exe?A2=ind0909&L=scientific-linux-errata&T=0&P=80
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?c3651c23"
      );
      script_set_attribute(
        attribute:"solution", 
        value:"Update the affected dnsmasq package."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:P/I:P/A:P");
      script_cwe_id(119, 399);
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"x-cpe:/o:fermilab:scientific_linux");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2009/08/31");
      script_set_attribute(attribute:"plugin_publication_date", value:"2012/08/01");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2012-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"Scientific Linux Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/cpu", "Host/RedHat/release", "Host/RedHat/rpm-list");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/RedHat/release");
    if (isnull(release) || "Scientific Linux " >!< release) audit(AUDIT_HOST_NOT, "running Scientific Linux");
    if (!get_kb_item("Host/RedHat/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if (cpu >!< "x86_64" && cpu !~ "^i[3-6]86$") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "Scientific Linux", cpu);
    
    
    flag = 0;
    if (rpm_check(release:"SL5", reference:"dnsmasq-2.45-1.1.el5_3")) flag++;
    
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:rpm_report_get());
      else security_warning(0);
      exit(0);
    }
    else audit(AUDIT_HOST_NOT, "affected");
    
  • NASL familyRed Hat Local Security Checks
    NASL idREDHAT-RHSA-2009-1238.NASL
    descriptionAn updated dnsmasq package that fixes two security issues is now available for Red Hat Enterprise Linux 5. This update has been rated as having important security impact by the Red Hat Security Response Team. Dnsmasq is a lightweight and easy to configure DNS forwarder and DHCP server. Core Security Technologies discovered a heap overflow flaw in dnsmasq when the TFTP service is enabled (the
    last seen2020-06-01
    modified2020-06-02
    plugin id40834
    published2009-09-02
    reporterThis script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/40834
    titleRHEL 5 : dnsmasq (RHSA-2009:1238)
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from Red Hat Security Advisory RHSA-2009:1238. The text 
    # itself is copyright (C) Red Hat, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(40834);
      script_version ("1.25");
      script_cvs_date("Date: 2019/10/25 13:36:14");
    
      script_cve_id("CVE-2009-2957", "CVE-2009-2958");
      script_bugtraq_id(36120);
      script_xref(name:"RHSA", value:"2009:1238");
    
      script_name(english:"RHEL 5 : dnsmasq (RHSA-2009:1238)");
      script_summary(english:"Checks the rpm output for the updated package");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Red Hat host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "An updated dnsmasq package that fixes two security issues is now
    available for Red Hat Enterprise Linux 5.
    
    This update has been rated as having important security impact by the
    Red Hat Security Response Team.
    
    Dnsmasq is a lightweight and easy to configure DNS forwarder and DHCP
    server.
    
    Core Security Technologies discovered a heap overflow flaw in dnsmasq
    when the TFTP service is enabled (the '--enable-tftp' command line
    option, or by enabling 'enable-tftp' in '/etc/dnsmasq.conf'). If the
    configured tftp-root is sufficiently long, and a remote user sends a
    request that sends a long file name, dnsmasq could crash or, possibly,
    execute arbitrary code with the privileges of the dnsmasq service
    (usually the unprivileged 'nobody' user). (CVE-2009-2957)
    
    A NULL pointer dereference flaw was discovered in dnsmasq when the
    TFTP service is enabled. This flaw could allow a malicious TFTP client
    to crash the dnsmasq service. (CVE-2009-2958)
    
    Note: The default tftp-root is '/var/ftpd', which is short enough to
    make it difficult to exploit the CVE-2009-2957 issue; if a longer
    directory name is used, arbitrary code execution may be possible. As
    well, the dnsmasq package distributed by Red Hat does not have TFTP
    support enabled by default.
    
    All users of dnsmasq should upgrade to this updated package, which
    contains a backported patch to correct these issues. After installing
    the updated package, the dnsmasq service must be restarted for the
    update to take effect."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://access.redhat.com/security/cve/cve-2009-2957"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://access.redhat.com/security/cve/cve-2009-2958"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://access.redhat.com/errata/RHSA-2009:1238"
      );
      script_set_attribute(
        attribute:"solution", 
        value:"Update the affected dnsmasq package."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:P/I:P/A:P");
      script_set_cvss_temporal_vector("CVSS2#E:POC/RL:OF/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"true");
      script_cwe_id(119, 399);
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:dnsmasq");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:redhat:enterprise_linux:5");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:redhat:enterprise_linux:5.3");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2009/09/02");
      script_set_attribute(attribute:"patch_publication_date", value:"2009/08/31");
      script_set_attribute(attribute:"plugin_publication_date", value:"2009/09/02");
      script_set_attribute(attribute:"generated_plugin", value:"current");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"Red Hat Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/RedHat/release", "Host/RedHat/rpm-list", "Host/cpu");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("misc_func.inc");
    include("rpm.inc");
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/RedHat/release");
    if (isnull(release) || "Red Hat" >!< release) audit(AUDIT_OS_NOT, "Red Hat");
    os_ver = pregmatch(pattern: "Red Hat Enterprise Linux.*release ([0-9]+(\.[0-9]+)?)", string:release);
    if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "Red Hat");
    os_ver = os_ver[1];
    if (! preg(pattern:"^5([^0-9]|$)", string:os_ver)) audit(AUDIT_OS_NOT, "Red Hat 5.x", "Red Hat " + os_ver);
    
    if (!get_kb_item("Host/RedHat/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if ("x86_64" >!< cpu && cpu !~ "^i[3-6]86$" && "s390" >!< cpu) audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "Red Hat", cpu);
    
    yum_updateinfo = get_kb_item("Host/RedHat/yum-updateinfo");
    if (!empty_or_null(yum_updateinfo)) 
    {
      rhsa = "RHSA-2009:1238";
      yum_report = redhat_generate_yum_updateinfo_report(rhsa:rhsa);
      if (!empty_or_null(yum_report))
      {
        security_report_v4(
          port       : 0,
          severity   : SECURITY_WARNING,
          extra      : yum_report 
        );
        exit(0);
      }
      else
      {
        audit_message = "affected by Red Hat security advisory " + rhsa;
        audit(AUDIT_OS_NOT, audit_message);
      }
    }
    else
    {
      flag = 0;
      if (rpm_check(release:"RHEL5", cpu:"i386", reference:"dnsmasq-2.45-1.1.el5_3")) flag++;
    
      if (rpm_check(release:"RHEL5", cpu:"s390x", reference:"dnsmasq-2.45-1.1.el5_3")) flag++;
    
      if (rpm_check(release:"RHEL5", cpu:"x86_64", reference:"dnsmasq-2.45-1.1.el5_3")) flag++;
    
    
      if (flag)
      {
        security_report_v4(
          port       : 0,
          severity   : SECURITY_WARNING,
          extra      : rpm_report_get() + redhat_report_package_caveat()
        );
        exit(0);
      }
      else
      {
        tested = pkg_tests_get();
        if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
        else audit(AUDIT_PACKAGE_NOT_INSTALLED, "dnsmasq");
      }
    }
    
  • NASL familyOracle Linux Local Security Checks
    NASL idORACLELINUX_ELSA-2009-1238.NASL
    descriptionFrom Red Hat Security Advisory 2009:1238 : An updated dnsmasq package that fixes two security issues is now available for Red Hat Enterprise Linux 5. This update has been rated as having important security impact by the Red Hat Security Response Team. Dnsmasq is a lightweight and easy to configure DNS forwarder and DHCP server. Core Security Technologies discovered a heap overflow flaw in dnsmasq when the TFTP service is enabled (the
    last seen2020-06-01
    modified2020-06-02
    plugin id67918
    published2013-07-12
    reporterThis script is Copyright (C) 2013-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/67918
    titleOracle Linux 5 : dnsmasq (ELSA-2009-1238)
  • NASL familyDebian Local Security Checks
    NASL idDEBIAN_DSA-1876.NASL
    descriptionSeveral remote vulnerabilities have been discovered in the TFTP component of dnsmasq. The Common Vulnerabilities and Exposures project identifies the following problems : - CVE-2009-2957 A buffer overflow in TFTP processing may enable arbitrary code execution to attackers which are permitted to use the TFTP service. - CVE-2009-2958 Malicious TFTP clients may crash dnsmasq, leading to denial of service.
    last seen2020-06-01
    modified2020-06-02
    plugin id44741
    published2010-02-24
    reporterThis script is Copyright (C) 2010-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/44741
    titleDebian DSA-1876-1 : dnsmasq - buffer overflow
  • NASL familyFreeBSD Local Security Checks
    NASL idFREEBSD_PKG_80AA98E097B411DEB9460030843D3802.NASL
    descriptionSimon Kelley reports : Fix security problem which allowed any host permitted to do TFTP to possibly compromise dnsmasq by remote buffer overflow when TFTP enabled. Fix a problem which allowed a malicious TFTP client to crash dnsmasq.
    last seen2020-06-01
    modified2020-06-02
    plugin id40858
    published2009-09-03
    reporterThis script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/40858
    titleFreeBSD : dnsmasq -- TFTP server remote code injection vulnerability (80aa98e0-97b4-11de-b946-0030843d3802)
  • NASL familyFedora Local Security Checks
    NASL idFEDORA_2009-10252.NASL
    descriptionThis update fixes two security issues with dnsmasq
    last seen2020-06-01
    modified2020-06-02
    plugin id42121
    published2009-10-15
    reporterThis script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/42121
    titleFedora 10 : dnsmasq-2.46-2.fc10 (2009-10252)
  • NASL familyUbuntu Local Security Checks
    NASL idUBUNTU_USN-827-1.NASL
    descriptionIvAin Arce, Pablo HernAin Jorge, Alejandro Pablo Rodriguez, MartAn Coco, Alberto SoliAto Testa and Pablo Annetta discovered that Dnsmasq did not properly validate its input when processing TFTP requests for files with long names. A remote attacker could cause a denial of service or execute arbitrary code with user privileges. Dnsmasq runs as the
    last seen2020-06-01
    modified2020-06-02
    plugin id40848
    published2009-09-02
    reporterUbuntu Security Notice (C) 2009-2019 Canonical, Inc. / NASL script (C) 2009-2018 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/40848
    titleUbuntu 8.04 LTS / 8.10 / 9.04 : dnsmasq vulnerabilities (USN-827-1)
  • NASL familyCentOS Local Security Checks
    NASL idCENTOS_RHSA-2009-1238.NASL
    descriptionAn updated dnsmasq package that fixes two security issues is now available for Red Hat Enterprise Linux 5. This update has been rated as having important security impact by the Red Hat Security Response Team. Dnsmasq is a lightweight and easy to configure DNS forwarder and DHCP server. Core Security Technologies discovered a heap overflow flaw in dnsmasq when the TFTP service is enabled (the
    last seen2020-06-01
    modified2020-06-02
    plugin id43778
    published2010-01-06
    reporterThis script is Copyright (C) 2010-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/43778
    titleCentOS 5 : dnsmasq (CESA-2009:1238)

Oval

accepted2013-04-29T04:06:32.494-04:00
classvulnerability
contributors
  • nameAharon Chernin
    organizationSCAP.com, LLC
  • nameDragos Prisaca
    organizationG2, Inc.
definition_extensions
  • commentThe operating system installed on the system is Red Hat Enterprise Linux 5
    ovaloval:org.mitre.oval:def:11414
  • commentThe operating system installed on the system is CentOS Linux 5.x
    ovaloval:org.mitre.oval:def:15802
  • commentOracle Linux 5.x
    ovaloval:org.mitre.oval:def:15459
descriptionHeap-based buffer overflow in the tftp_request function in tftp.c in dnsmasq before 2.50, when --enable-tftp is used, might allow remote attackers to execute arbitrary code via a long filename in a TFTP packet, as demonstrated by a read (aka RRQ) request.
familyunix
idoval:org.mitre.oval:def:10538
statusaccepted
submitted2010-07-09T03:56:16-04:00
titleHeap-based buffer overflow in the tftp_request function in tftp.c in dnsmasq before 2.50, when --enable-tftp is used, might allow remote attackers to execute arbitrary code via a long filename in a TFTP packet, as demonstrated by a read (aka RRQ) request.
version18

Packetstorm

data sourcehttps://packetstormsecurity.com/files/download/80896/CORE-2009-0820.txt
idPACKETSTORM:80896
last seen2016-12-05
published2009-09-02
reporterCore Security Technologies
sourcehttps://packetstormsecurity.com/files/80896/Core-Security-Technologies-Advisory-2009.0820.html
titleCore Security Technologies Advisory 2009.0820

Redhat

advisories
  • rhsa
    idRHSA-2009:1238
  • rhsa
    idRHSA-2010:0095
rpms
  • dnsmasq-0:2.45-1.1.el5_3
  • dnsmasq-debuginfo-0:2.45-1.1.el5_3

Seebug

  • bulletinFamilyexploit
    descriptionNo description provided by source.
    idSSV:12710
    last seen2017-11-19
    modified2009-09-09
    published2009-09-09
    reporterRoot
    sourcehttps://www.seebug.org/vuldb/ssvid-12710
    titleDnsmasq &lt; 2.50 Heap Overflow &amp; Null pointer Dereference Vulns
  • bulletinFamilyexploit
    descriptionBUGTRAQ ID: 36121 CVE(CAN) ID: CVE-2009-2957 Dnsmasq是可方便配置的轻型DNS转发器和DHCP服务器。 dnsmasq在启用了TFTP服务(--enable-tftp命令行选项或在/etc/dnsmasq.conf中启用enable-tftp)的时候存在堆溢出漏洞。如果所配置的tftp-root足够长,且远程用户发送的请求中包含有超长的文件名,dnsmasq就可能崩溃或以dnsmasq服务的权限(通常为非特权的nobody用户)执行任意代码。 tftp_request对daemon-&gt;namebuff调用strncat,其预定义大小为MAXDNAME字节(默认1025)。 /----------- else if (filename[0] == '/') daemon-&gt;namebuff[0] = 0; strncat(daemon-&gt;namebuff, filename, MAXDNAME); - -----------/ 由于daemon-&gt;namebuff可能已经包含有数据,也就是通过配置文件传送给守护程序的daemon-&gt;tftp_prefix,因此这可能触发堆溢出。 /----------- if (daemon-&gt;tftp_prefix) { if (daemon-&gt;tftp_prefix[0] == '/') daemon-&gt;namebuff[0] = 0; strncat(daemon-&gt;namebuff, daemon-&gt;tftp_prefix, MAXDNAME) - -----------/ 默认的前缀是/var/tftpd,但如果使用了更长的前缀,就可能执行任意代码。 Simon Kelley Dnsmasq 2.4x 厂商补丁: RedHat ------ RedHat已经为此发布了一个安全公告(RHSA-2009:1238-01)以及相应补丁: RHSA-2009:1238-01:Important: dnsmasq security update 链接:https://www.redhat.com/support/errata/RHSA-2009-1238.html Simon Kelley ------------ 目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载: http://www.thekelleys.org.uk/dnsmasq/doc.html
    idSSV:12174
    last seen2017-11-19
    modified2009-09-02
    published2009-09-02
    reporterRoot
    sourcehttps://www.seebug.org/vuldb/ssvid-12174
    titleDnsmasq TFTP服务远程堆溢出漏洞
  • bulletinFamilyexploit
    descriptionNo description provided by source.
    idSSV:66871
    last seen2017-11-19
    modified2014-07-01
    published2014-07-01
    reporterRoot
    sourcehttps://www.seebug.org/vuldb/ssvid-66871
    titleDnsmasq < 2.50 - Heap Overflow & Null pointer Dereference Vulns