Vulnerabilities > CVE-2007-5198 - Improper Restriction of Operations Within the Bounds of A Memory Buffer vulnerability in Nagios Plugins

047910
CVSS 6.8 - MEDIUM
Attack vector
NETWORK
Attack complexity
MEDIUM
Privileges required
NONE
Confidentiality impact
PARTIAL
Integrity impact
PARTIAL
Availability impact
PARTIAL
network
nagios
CWE-119
nessus
exploit available

Summary

Buffer overflow in the redir function in check_http.c in Nagios Plugins before 1.4.10, when running with the -f (follow) option, allows remote web servers to execute arbitrary code via Location header responses (redirects) with a large number of leading "L" characters.

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

descriptionNagios Plugins 1.4.2/1.4.9 Location Header Remote Buffer Overflow Vulnerability. CVE-2007-5198. Dos exploit for linux platform
idEDB-ID:30646
last seen2016-02-03
modified2007-07-16
published2007-07-16
reporterNobuhiro Ban
sourcehttps://www.exploit-db.com/download/30646/
titleNagios Plugins 1.4.2/1.4.9 Location Header Remote Buffer Overflow Vulnerability

Nessus

  • NASL familySuSE Local Security Checks
    NASL idSUSE_NAGIOS-PLUGINS-4621.NASL
    descriptionfix possible buffer overflow during HTTP Location header parsing in check_http (CVE-2007-5198) fix possible buffer overflow during snmpget parsing in check_snmp (CVE-2007-5623)
    last seen2020-06-01
    modified2020-06-02
    plugin id28356
    published2007-11-29
    reporterThis script is Copyright (C) 2007-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/28356
    titleopenSUSE 10 Security Update : nagios-plugins (nagios-plugins-4621)
    code
    if (
        !defined_func("nasl_level") ||
        nasl_level() < 61201 ||
        (nasl_level() >= 70000 && nasl_level() < 70105) ||
        (nasl_level() >= 70200 && nasl_level() < 70203) ||
        (nasl_level() >= 80000 && nasl_level() < 80502)
        ) exit(0);
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were
    # extracted from openSUSE Security Update nagios-plugins-4621.
    #
    # The text description of this plugin is (C) SUSE LLC.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(28356);
      script_version ("1.9");
      script_cvs_date("Date: 2019/10/24 13:56:42");
    
      script_cve_id("CVE-2007-5198", "CVE-2007-5623");
    
      script_name(english:"openSUSE 10 Security Update : nagios-plugins (nagios-plugins-4621)");
      script_summary(english:"Check for the nagios-plugins-4621 patch");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote openSUSE host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "fix possible buffer overflow during HTTP Location header parsing in
    check_http (CVE-2007-5198) fix possible buffer overflow during snmpget
    parsing in check_snmp (CVE-2007-5623)"
      );
      script_set_attribute(
        attribute:"solution", 
        value:"Update the affected nagios-plugins packages."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:P/I:P/A:P");
      script_cwe_id(119);
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:nagios-plugins");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:nagios-plugins-extras");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:novell:opensuse:10.1");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:novell:opensuse:10.2");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:novell:opensuse:10.3");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2007/11/06");
      script_set_attribute(attribute:"plugin_publication_date", value:"2007/11/29");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2007-2019 Tenable Network Security, Inc.");
      script_family(english:"SuSE Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/SuSE/release", "Host/SuSE/rpm-list", "Host/cpu");
    
      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/SuSE/release");
    if (isnull(release) || release =~ "^(SLED|SLES)") audit(AUDIT_OS_NOT, "openSUSE");
    if (release !~ "^(SUSE10\.1|SUSE10\.2|SUSE10\.3)$") audit(AUDIT_OS_RELEASE_NOT, "openSUSE", "10.1 / 10.2 / 10.3", release);
    if (!get_kb_item("Host/SuSE/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    ourarch = get_kb_item("Host/cpu");
    if (!ourarch) audit(AUDIT_UNKNOWN_ARCH);
    if (ourarch !~ "^(i586|i686|x86_64)$") audit(AUDIT_ARCH_NOT, "i586 / i686 / x86_64", ourarch);
    
    flag = 0;
    
    if ( rpm_check(release:"SUSE10.1", reference:"nagios-plugins-1.4.2-16.6") ) flag++;
    if ( rpm_check(release:"SUSE10.1", reference:"nagios-plugins-extras-1.4.2-16.6") ) flag++;
    if ( rpm_check(release:"SUSE10.2", reference:"nagios-plugins-1.4.5-8") ) flag++;
    if ( rpm_check(release:"SUSE10.2", reference:"nagios-plugins-extras-1.4.5-8") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"nagios-plugins-1.4.9-19.3") ) flag++;
    if ( rpm_check(release:"SUSE10.3", reference:"nagios-plugins-extras-1.4.9-19.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, "nagios-plugins / nagios-plugins-extras");
    }
    
  • NASL familyFreeBSD Local Security Checks
    NASL idFREEBSD_PKG_7453C85D783011DCB4C80016179B2DD5.NASL
    descriptionA Secunia Advisory reports : The vulnerability is caused due to a boundary error within the redir() function in check_http.c when processing HTTP Location : header information. This can be exploited to cause a buffer overflow by returning an overly long string in the
    last seen2020-06-01
    modified2020-06-02
    plugin id27044
    published2007-10-15
    reporterThis script is Copyright (C) 2007-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/27044
    titleFreeBSD : nagios-plugins -- Long Location Header Buffer Overflow Vulnerability (7453c85d-7830-11dc-b4c8-0016179b2dd5)
  • NASL familySuSE Local Security Checks
    NASL idSUSE_NAGIOS-PLUGINS-4624.NASL
    descriptionfix possible buffer overflow during HTTP Location header parsing in check_http (CVE-2007-5198) fix possible buffer overflow during snmpget parsing in check_snmp. (CVE-2007-5623)
    last seen2020-06-01
    modified2020-06-02
    plugin id29526
    published2007-12-13
    reporterThis script is Copyright (C) 2007-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/29526
    titleSuSE 10 Security Update : nagios plugins (ZYPP Patch Number 4624)
  • NASL familyFedora Local Security Checks
    NASL idFEDORA_2008-3146.NASL
    descriptionUpstream released a new version. This also fixes CVE-2007-5198 (#315101). 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.
    last seen2020-06-01
    modified2020-06-02
    plugin id31981
    published2008-04-18
    reporterThis script is Copyright (C) 2008-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/31981
    titleFedora 7 : nagios-plugins-1.4.11-2.fc7 (2008-3146)
  • NASL familyFedora Local Security Checks
    NASL idFEDORA_2008-3098.NASL
    description - Tue Mar 18 2008 Tom
    last seen2020-06-01
    modified2020-06-02
    plugin id31978
    published2008-04-18
    reporterThis script is Copyright (C) 2008-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/31978
    titleFedora 8 : nagios-2.11-3.fc8 (2008-3098)
  • NASL familyUbuntu Local Security Checks
    NASL idUBUNTU_USN-532-1.NASL
    descriptionNobuhiro Ban discovered that check_http in nagios-plugins did not properly sanitize its input when following redirection requests. A malicious remote web server could cause a denial of service or possibly execute arbitrary code as the user. (CVE-2007-5198) Aravind Gottipati discovered that sslutils.c in nagios-plugins did not properly reset pointers to NULL. A malicious remote web server could cause a denial of service. Aravind Gottipati discovered that check_http in nagios-plugins did not properly calculate how much memory to reallocate when following redirection requests. A malicious remote web server could cause a denial of service. Note that Tenable Network Security has extracted the preceding description block directly from the Ubuntu security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id28138
    published2007-11-10
    reporterUbuntu Security Notice (C) 2007-2019 Canonical, Inc. / NASL script (C) 2018 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/28138
    titleUbuntu 6.06 LTS : nagios-plugins vulnerability (USN-532-1)
  • NASL familyDebian Local Security Checks
    NASL idDEBIAN_DSA-1495.NASL
    descriptionSeveral local/remote vulnerabilities have been discovered in two of the plugins for the Nagios network monitoring and management system. The Common Vulnerabilities and Exposures project identifies the following problems : - CVE-2007-5198 A buffer overflow has been discovered in the parser for HTTP Location headers (present in the check_http module). - CVE-2007-5623 A buffer overflow has been discovered in the check_snmp module.
    last seen2020-06-01
    modified2020-06-02
    plugin id31055
    published2008-02-14
    reporterThis script is Copyright (C) 2008-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/31055
    titleDebian DSA-1495-1 : nagios-plugins - buffer overflows
  • NASL familySuSE Local Security Checks
    NASL idSUSE9_11953.NASL
    descriptionfix possible buffer overflow during HTTP Location header parsing in check_http (CVE-2007-5198) fix possible buffer overflow during snmpget parsing in check_snmp. (CVE-2007-5623)
    last seen2020-06-01
    modified2020-06-02
    plugin id41162
    published2009-09-24
    reporterThis script is Copyright (C) 2009-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/41162
    titleSuSE9 Security Update : nagios plugins (YOU Patch Number 11953)
  • NASL familyGentoo Local Security Checks
    NASL idGENTOO_GLSA-200711-11.NASL
    descriptionThe remote host is affected by the vulnerability described in GLSA-200711-11 (Nagios Plugins: Two buffer overflows) fabiodds reported a boundary checking error in the
    last seen2020-06-01
    modified2020-06-02
    plugin id27846
    published2007-11-09
    reporterThis script is Copyright (C) 2007-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/27846
    titleGLSA-200711-11 : Nagios Plugins: Two buffer overflows
  • NASL familyFedora Local Security Checks
    NASL idFEDORA_2008-3061.NASL
    descriptionUpstream released a new version. This also fixes CVE-2007-5198 (#315101). 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.
    last seen2020-06-01
    modified2020-06-02
    plugin id31975
    published2008-04-18
    reporterThis script is Copyright (C) 2008-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/31975
    titleFedora 8 : nagios-plugins-1.4.11-2.fc8 (2008-3061)