Apache Struts ClassLoader Manipulation - Nessus

High   Plugin ID: 73919

This page contains detailed information about the Apache Struts ClassLoader Manipulation Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 73919
Name: Apache Struts ClassLoader Manipulation
Filename: struts_classloader_manipulation.nasl
Vulnerability Published: 2014-04-29
This Plugin Published: 2014-05-08
Last Modification Time: 2022-04-11
Plugin Version: 1.12
Plugin Type: remote
Plugin Family: Denial of Service
Dependencies: http_version.nasl, webmirror.nasl

Vulnerability Information


Severity: High
Vulnerability Published: 2014-04-29
Patch Published: N/A
CVE [?]: CVE-2014-0114
CPE [?]: cpe:/a:apache:struts

Synopsis

The remote web server contains a web application that uses a Java framework that is affected by a ClassLoader manipulation vulnerability.

Description

The remote web application appears to use Struts, a web application framework. The version of Struts in use contains a flaw that allows the manipulation of the ClassLoader via the 'class' parameter of an ActionForm object that results a denial of service.

Note that this vulnerability may be exploited to execute arbitrary remote code in certain application servers with specific configurations; however, Nessus has not tested for this issue.

Additionally, note that this plugin will only report the first vulnerable instance of a Struts application.

Solution

Unknown at this time. Note that Struts 1 has reached end-of-life and is no longer supported.

Public Exploits


Target Network Port(s): 80, 8080
Target Asset(s): Services/www
Exploit Available: True (Metasploit Framework, Exploit-DB, GitHub)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the Apache Struts ClassLoader Manipulation vulnerability:

  1. Metasploit: exploit/multi/http/struts_code_exec_classloader
    [Apache Struts ClassLoader Manipulation Remote Code Execution]
  2. Exploit-DB: exploits/multiple/remote/41690.rb
    [EDB-41690: Apache Struts < 1.3.10 / < 2.3.16.2 - ClassLoader Manipulation Remote Code Execution (Metasploit)]
  3. GitHub: https://github.com/aenlr/strutt-cve-2014-0114
    [CVE-2014-0114]
  4. GitHub: https://github.com/ian4hu/super-pom
    [CVE-2014-0114]
  5. GitHub: https://github.com/rgielen/struts1filter
    [CVE-2014-0114: A request parameter filter solution for Struts 1 CVE-2014-0114 based on the work of ...]
  6. GitHub: https://github.com/stevegy/jmap
    [CVE-2014-0114]
  7. GitHub: https://github.com/vikasvns2000/StrutsExample
    [CVE-2014-0114]
  8. GitHub: https://github.com/zema1/oracle-vuln-crawler
    [CVE-2014-0114]
  9. GitHub: https://github.com/ricedu/struts1-patch
    [CVE-2014-0114: Struts1 CVE-2014-0114 classLoader manipulation vulnerability patch]

Before running any exploit against any system, make sure you are authorized by the owner of the target system(s) to perform such activity. In any other case, this would be considered as an illegal activity.

WARNING: Beware of using unverified exploits from sources such as GitHub or Exploit-DB. These exploits and PoCs could contain malware. For more information, see how to use exploits safely.

Risk Information


CVSS V2 Vector [?]: AV:N/AC:L/Au:N/C:P/I:P/A:P/E:F/RL:OF/RC:C
CVSS Base Score:7.5 (High)
Impact Subscore:6.4
Exploitability Subscore:10.0
CVSS Temporal Score:6.2 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:6.2 (Medium)

Go back to menu.

Plugin Source


This is the struts_classloader_manipulation.nasl nessus plugin source code. This script is Copyright (C) 2014-2022 Tenable Network Security, Inc.

#%NASL_MIN_LEVEL 70300
#
# (C) Tenable Network Security, Inc.
#

include('deprecated_nasl_level.inc');
include('compat.inc');

if (description)
{
  script_id(73919);
  script_version("1.12");
  script_set_attribute(attribute:"plugin_modification_date", value:"2022/04/11");

  script_cve_id("CVE-2014-0114");
  script_bugtraq_id(67121);

  script_name(english:"Apache Struts ClassLoader Manipulation");

  script_set_attribute(attribute:"synopsis", value:
"The remote web server contains a web application that uses a Java
framework that is affected by a ClassLoader manipulation
vulnerability.");
  script_set_attribute(attribute:"description", value:
"The remote web application appears to use Struts, a web application
framework. The version of Struts in use contains a flaw that allows
the manipulation of the ClassLoader via the 'class' parameter of an
ActionForm object that results a denial of service.

Note that this vulnerability may be exploited to execute arbitrary
remote code in certain application servers with specific
configurations; however, Nessus has not tested for this issue.

Additionally, note that this plugin will only report the first
vulnerable instance of a Struts application.");
  script_set_attribute(attribute:"see_also", value:"https://seclists.org/bugtraq/2014/Apr/177");
  script_set_attribute(attribute:"see_also", value:"https://bugzilla.redhat.com/show_bug.cgi?id=1091938");
  script_set_attribute(attribute:"see_also", value:"https://access.redhat.com/solutions/869353");
  script_set_attribute(attribute:"see_also", value:"https://struts.apache.org/struts1eol-announcement.html");
  # https://community.hpe.com/t5/custom/page/page-id/HPPSocialUserSignonPage?redirectreason=permissiondenied&referer=https%3A%2F%2Fcommunity.hpe.com%2Ft5%2FModeration-and-Management-Mods%2Fct-p%2FModeration#.U2eVtKJ6Nat
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?8458fe5f");
  script_set_attribute(attribute:"solution", value:
"Unknown at this time. Note that Struts 1 has reached end-of-life and
is no longer supported.");
  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:F/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:"metasploit_name", value:'Apache Struts ClassLoader Manipulation Remote Code Execution');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2014/04/29");
  script_set_attribute(attribute:"plugin_publication_date", value:"2014/05/08");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:apache:struts");
  script_set_attribute(attribute:"thorough_tests", value:"true");
  script_end_attributes();

  script_category(ACT_DENIAL);
  script_family(english:"Denial of Service");

  script_copyright(english:"This script is Copyright (C) 2014-2022 Tenable Network Security, Inc.");

  script_dependencies("http_version.nasl", "webmirror.nasl");
  script_require_ports("Services/www", 80, 8080);

  exit(0);
}

include("audit.inc");
include("global_settings.inc");
include("http.inc");
include("misc_func.inc");

port = get_http_port(default:8080);
cgis = get_kb_list('www/' + port + '/cgi');

urls = make_list();
# To identify actions that we can test the exploit on we will look
# for files with the .action and .do suffix from the KB.
if (!isnull(cgis))
{
  foreach cgi (cgis)
  {
    match = eregmatch(pattern:"((^.*)(/.+\.act(ion)?)($|\?|;))", string:cgi);
    if (!isnull(match))
    {
      urls = make_list(urls, match[0]);
      if (!thorough_tests) break;
    }
    match2 = eregmatch(pattern:"(^.*)(/.+\.do)$", string:cgi);
    if (!isnull(match2))
    {
      urls = make_list(urls, match2[0]);
      if (!thorough_tests) break;
    }
  }
}
if (thorough_tests)
{
  cgi2 = get_kb_list('www/' + port + '/content/extensions/act*');
  if (!isnull(cgi2)) urls = make_list(urls, cgi2);

  cgi3 = get_kb_list('www/' + port + '/content/extensions/do');
  if (!isnull(cgi3)) urls = make_list(urls, cgi3);
}

if (max_index(urls) == 0)
  audit(AUDIT_WEB_FILES_NOT, "Struts .do / .action", port);

urls = list_uniq(urls);

script = SCRIPT_NAME - ".nasl" + "-" + unixtime();

foreach url (urls)
{
  res = http_send_recv3(
    method : "GET",
    port   : port,
    item   : url,
    exit_on_fail : TRUE
  );

  if (res[0] != "404 Not Found")
  {
    vuln_url = url + "?class.classLoader.resources.dirContext.docBase=" +script;

    res2 = http_send_recv3(
      method : "GET",
      port   : port,
      item   : vuln_url,
      exit_on_fail : FALSE
    );

    if (
      (res2[0] =~ "200 OK|500 Internal Server Error")
    )
    { sleep(4);
      # One more check to ensure application is dead
      res = http_send_recv3(
        method : "GET",
        item   : url,
        port   : port,
        fetch404 : TRUE,
        exit_on_fail : TRUE
      );
      if (res[0] =~ "404 Not Found")
      {
        vuln = TRUE;
        # Stop after first vulnerable Struts app is found
        break;
      }
    }
  }
}

if (!vuln) exit(0, 'No vulnerable applications were detected on the web server listening on port '+port+'.');

security_report_v4(
  port       : port,
  severity   : SECURITY_HOLE,
  generic    : TRUE,
  request    : make_list(build_url(qs:vuln_url, port:port)),
  output     : chomp(res[2])
);

The latest version of this script can be found in these locations depending on your platform:

  • Linux / Unix:
    /opt/nessus/lib/nessus/plugins/struts_classloader_manipulation.nasl
  • Windows:
    C:\ProgramData\Tenable\Nessus\nessus\plugins\struts_classloader_manipulation.nasl
  • Mac OS X:
    /Library/Nessus/run/lib/nessus/plugins/struts_classloader_manipulation.nasl

Go back to menu.

How to Run


Here is how to run the Apache Struts ClassLoader Manipulation as a standalone plugin via the Nessus web user interface (https://localhost:8834/):

  1. Click to start a New Scan.
  2. Select Advanced Scan.
  3. Navigate to the Plugins tab.
  4. On the top right corner click to Disable All plugins.
  5. On the left side table select Denial of Service plugin family.
  6. On the right side table select Apache Struts ClassLoader Manipulation plugin ID 73919.
  7. Specify the target on the Settings tab and click to Save the scan.
  8. Run the scan.

Here are a few examples of how to run the plugin in the command line. Note that the examples below demonstrate the usage on the Linux / Unix platform.

Basic usage:

/opt/nessus/bin/nasl struts_classloader_manipulation.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a struts_classloader_manipulation.nasl -t <IP/HOST>

Run the plugin with trace script execution written to the console (useful for debugging):

/opt/nessus/bin/nasl -T - struts_classloader_manipulation.nasl -t <IP/HOST>

Run the plugin with using a state file for the target and updating it (useful for running multiple plugins on the target):

/opt/nessus/bin/nasl -K /tmp/state struts_classloader_manipulation.nasl -t <IP/HOST>

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: See also: Similar and related Nessus plugins:
  • 112192 - Apache ActiveMQ 5.x < 5.15.5 Multiple Vulnerabilities
  • 73922 - CentOS 5 : struts (CESA-2014:0474)
  • 82203 - Debian DLA-57-1 : libstruts1.2-java security update
  • 77306 - Debian DSA-2940-1 : libstruts1.2-java - security update
  • 77351 - Fedora 20 : struts-1.3.10-10.fc20 (2014-9380)
  • 92479 - GLSA-201607-09 : Commons-BeanUtils: Arbitrary code execution
  • 74073 - Mandriva Linux Security Advisory : struts (MDVSA-2014:095)
  • 78749 - Oracle Enterprise Data Quality Multiple Vulnerabilities (October 2014 CPU)
  • 78542 - Oracle Identity Manager (October 2014 CPU
  • 73935 - Oracle Linux 5 : struts (ELSA-2014-0474)
  • 78700 - Oracle Adaptive Access Manager Server Arbitrary Code Execution (October 2014 CPU)
  • 78541 - Oracle WebLogic Server Multiple Vulnerabilities (October 2014 CPU)
  • 73901 - RHEL 5 : struts (RHSA-2014:0474)
  • 79018 - RHEL 6 : struts (RHSA-2014:0500)
  • 73907 - Scientific Linux Security Update : struts on SL5.x i386/x86_64 (20140507)
  • 77728 - VMware Security Updates for vCenter Server (VMSA-2014-0008)
  • 77630 - VMSA-2014-0008 : VMware vSphere product updates to third-party libraries
  • 76967 - IBM WebSphere Application Server 7.0 < Fix Pack 33 Multiple Vulnerabilities
  • 141566 - IBM WebSphere Application Server 7.0.0.x <= 7.0.0.45 / 8.0.0.x <= 8.0.0.15 / 8.5.x < 8.5.5.14 / 9.0.x <= 9.0.0.9 Multiple Vulnerabilities (711865)
  • 79691 - IBM WebSphere Portal 7.0.0.x < 7.0.0.2 CF29 Multiple Vulnerabilities
  • 79216 - IBM WebSphere Portal 8.5.0 < 8.5.0 CF02 Multiple Vulnerabilities
  • 77535 - IBM WebSphere Portal Apache Struts ClassLoader Manipulation RCE
  • 73763 - Apache Struts 2 ClassLoader Manipulation Incomplete Fix for Security Bypass

Version


This page has been produced using Nessus Professional 10.1.2 (#68) LINUX, Plugin set 202205072148.
Plugin file struts_classloader_manipulation.nasl version 1.12. For more plugins, visit the Nessus Plugin Library.

Go back to menu.