Vulnerabilities > CVE-2015-1427

047910
CVSS 9.8 - CRITICAL
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
HIGH
Integrity impact
HIGH
Availability impact
HIGH
network
low complexity
elastic
redhat
critical
nessus
exploit available
metasploit

Summary

The Groovy scripting engine in Elasticsearch before 1.3.8 and 1.4.x before 1.4.3 allows remote attackers to bypass the sandbox protection mechanism and execute arbitrary shell commands via a crafted script.

Vulnerable Configurations

Part Description Count
Application
Elastic
121
Application
Redhat
1

Exploit-Db

  • descriptionElasticSearch Unauthenticated Remote Code Execution. CVE-2015-1427. Remote exploit for linux platform
    idEDB-ID:36337
    last seen2016-02-04
    modified2015-03-11
    published2015-03-11
    reporterXiphos Research Ltd
    sourcehttps://www.exploit-db.com/download/36337/
    titleElasticSearch Unauthenticated Remote Code Execution
  • descriptionElasticSearch Search Groovy Sandbox Bypass. CVE-2015-1427. Remote exploit for java platform
    idEDB-ID:36415
    last seen2016-02-04
    modified2015-03-16
    published2015-03-16
    reportermetasploit
    sourcehttps://www.exploit-db.com/download/36415/
    titleElasticSearch Search Groovy Sandbox Bypass

Metasploit

descriptionThis module exploits a remote command execution (RCE) vulnerability in ElasticSearch, exploitable by default on ElasticSearch prior to 1.4.3. The bug is found in the REST API, which does not require authentication, where the search function allows groovy code execution and its sandbox can be bypassed using java.lang.Math.class.forName to reference arbitrary classes. It can be used to execute arbitrary Java code. This module has been tested successfully on ElasticSearch 1.4.2 on Ubuntu Server 12.04.
idMSF:EXPLOIT/MULTI/ELASTICSEARCH/SEARCH_GROOVY_SCRIPT
last seen2020-06-06
modified2017-07-24
published2015-03-10
references
reporterRapid7
sourcehttps://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/multi/elasticsearch/search_groovy_script.rb
titleElasticSearch Search Groovy Sandbox Bypass

Nessus

  • NASL familyCGI abuses
    NASL idELASTICSEARCH_RCE_CVE-2015-1427.NASL
    descriptionThe Elasticsearch application hosted on the remote web server is affected by a remote code execution vulnerability due to unspecified flaws in the Groovy script engine. A remote unauthenticated attacker, using a specially crafted request, can escape the sandbox and execute arbitrary Java code. A successful attack could allow the user to gain a remote shell or manipulate files on the remote system.
    last seen2020-06-01
    modified2020-06-02
    plugin id81816
    published2015-03-13
    reporterThis script is Copyright (C) 2015-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/81816
    titleElasticsearch Groovy Script RCE
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(81816);
      script_version("1.13");
      script_cvs_date("Date: 2019/11/22");
    
      script_cve_id("CVE-2015-1427");
      script_bugtraq_id(72585);
    
      script_name(english:"Elasticsearch Groovy Script RCE");
      script_summary(english:"Attempts to execute arbitrary Java code.");
    
      script_set_attribute(attribute:"synopsis", value:
    "The remote web server hosts a Java application that is affected by a
    remote code execution vulnerability.");
      script_set_attribute(attribute:"description", value:
    "The Elasticsearch application hosted on the remote web server is
    affected by a remote code execution vulnerability due to unspecified
    flaws in the Groovy script engine. A remote unauthenticated attacker, 
    using a specially crafted request, can escape the sandbox and execute 
    arbitrary Java code. A successful attack  could allow the user to 
    gain a remote shell or manipulate files on the remote system.");
      script_set_attribute(attribute:"see_also", value:"https://seclists.org/bugtraq/2015/Feb/92");
      script_set_attribute(attribute:"see_also", value:"https://github.com/elastic/elasticsearch/issues/9655");
      script_set_attribute(attribute:"solution", value:
    "Upgrade to version 1.3.8 / 1.4.3 or later, or disable scripting.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P");
      script_set_cvss_temporal_vector("CVSS2#E:H/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:"exploit_framework_core", value:"true");
      script_set_attribute(attribute:"exploited_by_malware", value:"true");
      script_set_attribute(attribute:"metasploit_name", value:'ElasticSearch Search Groovy Sandbox Bypass');
      script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
      script_set_attribute(attribute:"exploit_framework_canvas", value:"true");
      script_set_attribute(attribute:"canvas_package", value:'CANVAS');
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2015/12/09");
      script_set_attribute(attribute:"patch_publication_date", value:"2015/02/11");
      script_set_attribute(attribute:"plugin_publication_date", value:"2015/03/13");
    
      script_set_attribute(attribute:"plugin_type", value:"remote");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:elasticsearch:elasticsearch");
      script_end_attributes();
    
      script_category(ACT_ATTACK);
      script_family(english:"CGI abuses");
    
      script_copyright(english:"This script is Copyright (C) 2015-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
    
      script_dependencies("elasticsearch_detect.nbin");
      script_require_keys("installed_sw/Elasticsearch");
      script_require_ports("Services/www", 9200);
    
      exit(0);
    }
    
    include("audit.inc");
    include("global_settings.inc");
    include("misc_func.inc");
    include("http.inc");
    include("webapp_func.inc");
    include("url_func.inc");
    
    app = "Elasticsearch";
    get_install_count(app_name:app, exit_if_zero:TRUE);
    
    port = get_http_port(default:9200);
    
    install = get_single_install(
      app_name            : app,
      port                : port
    );
    
    dir  = install['path'];
    url  = build_url(qs:dir, port:port);
    vuln = FALSE;
    
    data = '{
      "size": 1,
      "query": {
        "match_all": {}
      },
      "script_fields": {
        "myscript": {
          "script": "java.lang.Math.class.forName(\\"java.lang.System\\").getProperties()"
        }
      }
    }';
    
    res = http_send_recv3(
      method:'POST',
      port:port,
      item:dir+"_search?pretty",
      content_type:'application/json',
      data:data,
      exit_on_fail:TRUE
    );
    
    vuln = (
      "200 OK"                           >< res[0] &&
      "java.specification.version"       >< res[2] &&
      "java.version"                     >< res[2]
    );
    
    if (!vuln) 
      audit(AUDIT_WEB_APP_NOT_AFFECTED, app, url);
    
    attack = build_url(qs:attack, port:port);
    security_report_v4(
      port       : port,
      severity   : SECURITY_HOLE,
      cmd        : "System.getProperties()",
      output     : res[2],
      line_limit : 25,
      request    : make_list(attack)
    );
    
  • NASL familyFreeBSD Local Security Checks
    NASL idFREEBSD_PKG_026759E01BA311E5B43D002590263BF5.NASL
    descriptionElastic reports : Vulnerability Summary: Elasticsearch versions 1.3.0-1.3.7 and 1.4.0-1.4.2 have vulnerabilities in the Groovy scripting engine that were introduced in 1.3.0. The vulnerability allows an attacker to construct Groovy scripts that escape the sandbox and execute shell commands as the user running the Elasticsearch Java VM. Remediation Summary: Users should upgrade to 1.3.8 or 1.4.3. Users that do not want to upgrade can address the vulnerability by setting script.groovy.sandbox.enabled to false in elasticsearch.yml and restarting the node.
    last seen2020-06-01
    modified2020-06-02
    plugin id84409
    published2015-06-26
    reporterThis script is Copyright (C) 2015-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/84409
    titleFreeBSD : elasticsearch -- remote OS command execution via Groovy scripting engine (026759e0-1ba3-11e5-b43d-002590263bf5)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from the FreeBSD VuXML database :
    #
    # Copyright 2003-2019 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(84409);
      script_version("2.9");
      script_cvs_date("Date: 2019/10/16 10:34:21");
    
      script_cve_id("CVE-2015-1427");
      script_bugtraq_id(72585);
    
      script_name(english:"FreeBSD : elasticsearch -- remote OS command execution via Groovy scripting engine (026759e0-1ba3-11e5-b43d-002590263bf5)");
      script_summary(english:"Checks for updated packages in pkg_info output");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:
    "The remote FreeBSD host is missing one or more security-related
    updates."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "Elastic reports :
    
    Vulnerability Summary: Elasticsearch versions 1.3.0-1.3.7 and
    1.4.0-1.4.2 have vulnerabilities in the Groovy scripting engine that
    were introduced in 1.3.0. The vulnerability allows an attacker to
    construct Groovy scripts that escape the sandbox and execute shell
    commands as the user running the Elasticsearch Java VM.
    
    Remediation Summary: Users should upgrade to 1.3.8 or 1.4.3. Users
    that do not want to upgrade can address the vulnerability by setting
    script.groovy.sandbox.enabled to false in elasticsearch.yml and
    restarting the node."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.elastic.co/community/security"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.elastic.co/blog/elasticsearch-1-4-3-and-1-3-8-released"
      );
      # http://www.securityfocus.com/archive/1/archive/1/534689/100/0/threaded
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?ef73e92b"
      );
      # https://packetstormsecurity.com/files/130368/Elasticsearch-1.3.7-1.4.2-Sandbox-Escape-Command-Execution.html
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?4bfad246"
      );
      # https://packetstormsecurity.com/files/130784/ElasticSearch-Unauthenticated-Remote-Code-Execution.html
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?75ce4361"
      );
      # https://vuxml.freebsd.org/freebsd/026759e0-1ba3-11e5-b43d-002590263bf5.html
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?5e8f6d25"
      );
      script_set_attribute(attribute:"solution", value:"Update the affected packages.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/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_set_attribute(attribute:"exploit_framework_core", value:"true");
      script_set_attribute(attribute:"exploited_by_malware", value:"true");
      script_set_attribute(attribute:"metasploit_name", value:'ElasticSearch Search Groovy Sandbox Bypass');
      script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
      script_set_attribute(attribute:"exploit_framework_canvas", value:"true");
      script_set_attribute(attribute:"canvas_package", value:'CANVAS');
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:freebsd:freebsd:elasticsearch");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:freebsd:freebsd");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2015/02/11");
      script_set_attribute(attribute:"patch_publication_date", value:"2015/06/26");
      script_set_attribute(attribute:"plugin_publication_date", value:"2015/06/26");
      script_set_attribute(attribute:"generated_plugin", value:"current");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2015-2019 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:"elasticsearch>=1.3.0<1.3.8")) flag++;
    if (pkg_test(save_report:TRUE, pkg:"elasticsearch>=1.4.0<1.4.3")) flag++;
    
    if (flag)
    {
      if (report_verbosity > 0) security_hole(port:0, extra:pkg_report_get());
      else security_hole(0);
      exit(0);
    }
    else audit(AUDIT_HOST_NOT, "affected");
    

Packetstorm

Redhat

advisories
rhsa
idRHSA-2017:0868