Apache Struts 2.x < 2.3.20 Multiple ClassLoader Manipulation Vulnerabilities (S2-021) - Nessus

High   Plugin ID: 117457

This page contains detailed information about the Apache Struts 2.x < 2.3.20 Multiple ClassLoader Manipulation Vulnerabilities (S2-021) Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 117457
Name: Apache Struts 2.x < 2.3.20 Multiple ClassLoader Manipulation Vulnerabilities (S2-021)
Filename: struts_2_3_16_2.nasl
Vulnerability Published: 2014-04-24
This Plugin Published: 2018-09-12
Last Modification Time: 2022-04-11
Plugin Version: 1.12
Plugin Type: combined
Plugin Family: Misc.
Dependencies: os_fingerprint.nasl, struts_config_browser_detect.nbin, struts_detect_nix.nbin, struts_detect_win.nbin

Vulnerability Information


Severity: High
Vulnerability Published: 2014-04-24
Patch Published: 2014-04-24
CVE [?]: CVE-2014-0112, CVE-2014-0113
CPE [?]: cpe:/a:apache:struts

Synopsis

A web application running on the remote host uses a Java framework that is affected by multiple class loader vulnerabilities.

Description

The version of Apache Struts running on the remote host is 2.x prior to to 2.3.20. It, therefore, is affected by multiple class loader vulnerabilities:

- A class loader vulnerability exists in ParametersInterceptor due to improper access restriction to the getClass method. A remote, unauthenticated attacker can exploit this to manipulate the ClassLoader and execute arbitrary code. (CVE-2014-0112)

- A class loader vulnerability exists in CookieInterceptor due to improper access restriction to the getClass. A remote, unauthenticated attacker can exploit this, via a specially crafted request which uses a wildcard cookiesName value to manipulate the ClassLoader and execute arbitrary code. (CVE-2014-0113)

Note that Nessus has not tested for these issues but has instead relied only on the application's self-reported version number.

Solution

Upgrade to Apache Struts version 2.3.20 or later

Public Exploits


Target Network Port(s): N/A
Target Asset(s): installed_sw/Apache Struts, installed_sw/Struts
Exploit Available: True (Metasploit Framework, Exploit-DB, D2 Elliot)
Exploit Ease: Exploits are available

Here's the list of publicly known exploits and PoCs for verifying the Apache Struts 2.x < 2.3.20 Multiple ClassLoader Manipulation Vulnerabilities (S2-021) vulnerability:

  1. Metasploit: exploit/multi/http/struts_code_exec_classloader
    [Apache Struts ClassLoader Manipulation Remote Code Execution]
  2. Exploit-DB: exploits/multiple/remote/33142.rb
    [EDB-33142: Apache Struts - ClassLoader Manipulation Remote Code Execution (Metasploit)]
  3. Exploit-DB: exploits/multiple/remote/41690.rb
    [EDB-41690: Apache Struts < 1.3.10 / < 2.3.16.2 - ClassLoader Manipulation Remote Code Execution (Metasploit)]

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 Score Source [?]: CVE-2014-0113
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)
CVSS V3 Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L/E:F/RL:O/RC:C
CVSS Base Score:7.3 (High)
Impact Subscore:3.4
Exploitability Subscore:3.9
CVSS Temporal Score:6.8 (Medium)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:6.8 (Medium)

Go back to menu.

Plugin Source


This is the struts_2_3_16_2.nasl nessus plugin source code. This script is Copyright (C) 2019-2022 and is owned by Tenable, Inc. or an Affiliate thereof.

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

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

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

  script_cve_id("CVE-2014-0112", "CVE-2014-0113");
  script_bugtraq_id(61189, 61196);

  script_name(english:"Apache Struts 2.x < 2.3.20 Multiple ClassLoader Manipulation Vulnerabilities (S2-021)");

  script_set_attribute(attribute:"synopsis", value:
"A web application running on the remote host uses a Java framework that is affected by multiple class loader
vulnerabilities.");
  script_set_attribute(attribute:"description", value:
"The version of Apache Struts running on the remote host is 2.x prior to to 2.3.20. It, therefore, is affected by
multiple class loader vulnerabilities:

  - A class loader vulnerability exists in ParametersInterceptor due to improper access restriction to the getClass
    method. A remote, unauthenticated attacker can exploit this to manipulate the ClassLoader and execute arbitrary
    code. (CVE-2014-0112)

  - A class loader vulnerability exists in CookieInterceptor due to improper access restriction to the getClass. A
    remote, unauthenticated attacker can exploit this, via a specially crafted request which uses a wildcard cookiesName
    value to manipulate the ClassLoader and execute arbitrary code. (CVE-2014-0113)

Note that Nessus has not tested for these issues but has instead relied only on the application's self-reported version
number.");
  # https://cwiki.apache.org/confluence/display/WW/S2-021
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?736174c4");
  script_set_attribute(attribute:"solution", value:
"Upgrade to Apache Struts version 2.3.20 or later");
  script_set_attribute(attribute:"agent", value:"all");
  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_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:F/RL:O/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2014-0113");

  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"d2_elliot_name", value:"Apache-Struts DefaultActionMapper < 2.3.15.1 RCE Linux");
  script_set_attribute(attribute:"exploit_framework_d2_elliot", 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/24");
  script_set_attribute(attribute:"patch_publication_date", value:"2014/04/24");
  script_set_attribute(attribute:"plugin_publication_date", value:"2018/09/12");

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

  script_category(ACT_GATHER_INFO);
  script_family(english:"Misc.");

  script_copyright(english:"This script is Copyright (C) 2019-2022 and is owned by Tenable, Inc. or an Affiliate thereof.");

  script_dependencies("os_fingerprint.nasl", "struts_detect_win.nbin", "struts_detect_nix.nbin", "struts_config_browser_detect.nbin");
  script_require_ports("installed_sw/Apache Struts", "installed_sw/Struts");

  exit(0);
}

include('vcf.inc');

app_info = vcf::combined_get_app_info(app:'Apache Struts');

vcf::check_granularity(app_info:app_info, sig_segments:3);

constraints = [
  { 'min_version' : '2.0.0', 'max_version' : '2.3.16.3', 'fixed_version' : '2.3.20' }
];

vcf::check_version_and_report(app_info:app_info, constraints:constraints, severity:SECURITY_HOLE);

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

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

Go back to menu.

How to Run


Here is how to run the Apache Struts 2.x < 2.3.20 Multiple ClassLoader Manipulation Vulnerabilities (S2-021) 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 Misc. plugin family.
  6. On the right side table select Apache Struts 2.x < 2.3.20 Multiple ClassLoader Manipulation Vulnerabilities (S2-021) plugin ID 117457.
  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_2_3_16_2.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

/opt/nessus/bin/nasl -T - struts_2_3_16_2.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_2_3_16_2.nasl -t <IP/HOST>

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: See also: Similar and related Nessus plugins:
  • 83293 - MySQL Enterprise Monitor < 2.3.17 Multiple Vulnerabilities
  • 83295 - MySQL Enterprise Monitor 3.0.x < 3.0.11 Multiple Vulnerabilities
  • 83469 - Oracle WebCenter Sites Multiple Vulnerabilities (April 2015 CPU)
  • 73763 - Apache Struts 2 ClassLoader Manipulation Incomplete Fix for Security Bypass
  • 76388 - VMware vCenter Operations Management Suite Multiple Vulnerabilities (VMSA-2014-0007)
  • 73761 - Apache Archiva 1.2.x <= 1.2.2 / 1.3.x <= 1.3.6 Multiple Vulnerabilities
  • 83292 - MySQL Enterprise Monitor < 2.3.14 Apache Struts Multiple Vulnerabilities
  • 142462 - Selligent Message Studio Struts Code Execution (CVE-2013-2251)
  • 68981 - Apache Struts 2 'action:' Parameter Arbitrary Remote Command Execution
  • 117362 - Apache Struts 2.x < 2.3.15.1 Multiple Vulnerabilities (S2-016) (S2-017)

Version


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

Go back to menu.