Jenkins < 1.638 / 1.625.2 Java Object Deserialization RCE - Nessus

High   Plugin ID: 86898

This page contains detailed information about the Jenkins < 1.638 / 1.625.2 Java Object Deserialization RCE Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 86898
Name: Jenkins < 1.638 / 1.625.2 Java Object Deserialization RCE
Filename: jenkins_security218.nasl
Vulnerability Published: 2015-01-28
This Plugin Published: 2015-11-17
Last Modification Time: 2022-04-11
Plugin Version: 1.13
Plugin Type: remote
Plugin Family: General
Dependencies: jenkins_detect.nasl
Required KB Items [?]: www/Jenkins

Vulnerability Information


Severity: High
Vulnerability Published: 2015-01-28
Patch Published: 2015-11-11
CVE [?]: CVE-2015-8103
CPE [?]: cpe:/a:cloudbees:jenkins
In the News: True

Synopsis

The remote web server is affected by a remote code execution vulnerability.

Description

The remote web server hosts a version of Jenkins or Jenkins Enterprise that is prior to 1.638 or 1.625.2. It is, therefore, affected by a flaw in the Apache Commons Collections (ACC) library that allows the deserialization of unauthenticated Java objects. An unauthenticated, remote attacker can exploit this to execute arbitrary code on the target host.

Solution

Upgrade to Jenkins version 1.638 / 1.625.2 or later. Alternatively, disable the CLI port per the vendor advisory.

Public Exploits


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

Here's the list of publicly known exploits and PoCs for verifying the Jenkins < 1.638 / 1.625.2 Java Object Deserialization RCE vulnerability:

  1. Metasploit: exploit/linux/misc/opennms_java_serialize
    [OpenNMS Java Object Unserialization Remote Code Execution]
  2. Metasploit: auxiliary/scanner/http/jenkins_command
    [Jenkins-CI Unauthenticated Script-Console Scanner]
  3. Metasploit: exploit/linux/misc/jenkins_java_deserialize
    [Jenkins CLI RMI Java Deserialization Vulnerability]
  4. Exploit-DB: exploits/java/remote/38983.rb
    [EDB-38983: Jenkins CLI - RMI Java Deserialization (Metasploit)]
  5. GitHub: https://github.com/3vikram/Application-Vulnerabilities-Payloads
    [CVE-2015-8103]
  6. GitHub: https://github.com/84KaliPleXon3/Payloads_All_The_Things
    [CVE-2015-8103]
  7. GitHub: https://github.com/Delishsploits/PayloadsAndMethodology
    [CVE-2015-8103]
  8. GitHub: https://github.com/GrrrDog/Java-Deserialization-Cheat-Sheet
    [CVE-2015-8103]
  9. GitHub: https://github.com/GuynnR/Payloads
    [CVE-2015-8103]
  10. GitHub: https://github.com/Muhammd/Awesome-Payloads
    [CVE-2015-8103]
  11. GitHub: https://github.com/NCSU-DANCE-Research-Group/CDL
    [CVE-2015-8103]
  12. GitHub: https://github.com/XPR1M3/Payloads_All_The_Things
    [CVE-2015-8103]
  13. GitHub: https://github.com/andrysec/PayloadsAllVulnerability
    [CVE-2015-8103]
  14. GitHub: https://github.com/anhtu97/PayloadAllEverything
    [CVE-2015-8103]
  15. GitHub: https://github.com/apkadmin/PayLoadsAll
    [CVE-2015-8103]
  16. GitHub: https://github.com/chanchalpatra/payload
    [CVE-2015-8103]
  17. GitHub: https://github.com/gquere/pwn_jenkins
    [CVE-2015-8103]
  18. GitHub: https://github.com/jiangsir404/POC-S
    [CVE-2015-8103]
  19. GitHub: https://github.com/koutto/jok3r-pocs
    [CVE-2015-8103]
  20. GitHub: https://github.com/mrhacker51/ReverseShellCommands
    [CVE-2015-8103]
  21. GitHub: https://github.com/sobinge/PayloadsAllThesobinge
    [CVE-2015-8103]
  22. GitHub: https://github.com/sobinge/--1
    [CVE-2015-8103]
  23. GitHub: https://github.com/cved-sources/cve-2015-8103
    [CVE-2015-8103: Cve-2015-8103]
  24. Immunity Canvas: CANVAS

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-2015-8103
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 jenkins_security218.nasl nessus plugin source code. This script is Copyright (C) 2015-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(86898);
  script_version("1.13");
  script_set_attribute(attribute:"plugin_modification_date", value:"2022/04/11");

  script_cve_id("CVE-2015-8103");
  script_bugtraq_id(77636);
  script_xref(name:"CERT", value:"576313");

  script_name(english:"Jenkins < 1.638 / 1.625.2 Java Object Deserialization RCE");

  script_set_attribute(attribute:"synopsis", value:
"The remote web server is affected by a remote code execution
vulnerability.");
  script_set_attribute(attribute:"description", value:
"The remote web server hosts a version of Jenkins or Jenkins Enterprise
that is prior to 1.638 or 1.625.2. It is, therefore, affected by a
flaw in the Apache Commons Collections (ACC) library that allows the
deserialization of unauthenticated Java objects. An unauthenticated,
remote attacker can exploit this to execute arbitrary code on the
target host.");
  # https://jenkins-ci.org/content/mitigating-unauthenticated-remote-code-execution-0-day-jenkins-cli
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?0316bc02");
  # https://foxglovesecurity.com/2015/11/06/what-do-weblogic-websphere-jboss-jenkins-opennms-and-your-application-have-in-common-this-vulnerability/
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?9c6d83db");
  script_set_attribute(attribute:"see_also", value:"https://github.com/jenkinsci-cert/SECURITY-218");
  script_set_attribute(attribute:"see_also", value:"https://issues.apache.org/jira/browse/COLLECTIONS-580");
  script_set_attribute(attribute:"solution", value:
"Upgrade to Jenkins version 1.638 / 1.625.2 or later. Alternatively,
disable the CLI port per the vendor advisory.");
  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:"cvss_score_source", value:"CVE-2015-8103");

  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:"metasploit_name", value:'OpenNMS Java Object Unserialization Remote Code Execution');
  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:"in_the_news", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2015/01/28");
  script_set_attribute(attribute:"patch_publication_date", value:"2015/11/11");
  script_set_attribute(attribute:"plugin_publication_date", value:"2015/11/17");

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

  script_category(ACT_GATHER_INFO);
  script_family(english:"General");

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

  script_dependencies("jenkins_detect.nasl");
  script_require_keys("www/Jenkins");
  script_require_ports("Services/www", 8080);

  exit(0);
}

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

port = get_http_port(default:8080);
get_kb_item_or_exit("www/Jenkins/"+port+"/Installed");

# LTS has a different version number
is_LTS = get_kb_item("www/Jenkins/"+port+"/is_LTS");
if (is_LTS)
{
  appname = "Jenkins Open Source LTS";
  fixed = "1.625.2";
}
else
{
  appname = "Jenkins Open Source";
  fixed = "1.638";
}

# check the patched versions
version = get_kb_item_or_exit("www/Jenkins/"+port+"/JenkinsVersion");
if (version == "unknown") audit(AUDIT_UNKNOWN_APP_VER, appname);
if (ver_compare(ver: version, fix: fixed, strict: FALSE) >= 0) audit(AUDIT_INST_VER_NOT_VULN, appname, version);

# if the version is less than the patch version then check to see if the CLI port is enabled
url = build_url(qs:'/', port: port);
res = http_send_recv3(method:"GET", item:url, port:port, exit_on_fail:TRUE);
if (("X-Jenkins-CLI-Port" >!< res[1]) &&
  ("X-Jenkins-CLI2-Port" >!< res[1]) &&
  ("X-Hudson-CLI-Port" >!< res[1])) audit(AUDIT_INST_VER_NOT_VULN, appname, version);

# Find a CLI port to examine
item = eregmatch(pattern:"X-Jenkins-CLI-Port:\s*([0-9]+)[ \r\n]", string: res[1]);
if (isnull(item))
{
  item = eregmatch(pattern:"X-Hudson-CLI-Port:\s*([0-9]+)[ \r\n]", string: res[1]);
  if (isnull(item))
  {
    item = eregmatch(pattern:"X-Jenkins-CLI2-Port:\s*([0-9]+)[ \r\n]", string: res[1]);
    if (isnull(item)) audit(AUDIT_RESP_BAD, port);
  }
}

sock = open_sock_tcp(item[1]);
if (!sock) audit(AUDIT_NOT_LISTEN, appname, item[1]);

send(socket: sock, data: '\x00\x14' +  "Protocol:CLI-connect");
return_val = recv(socket: sock, length: 20, min: 9, timeout: 1);
close(sock);

if (isnull(return_val) || len(return_val) < 9) audit(AUDIT_RESP_BAD, res[1]);
if ("Unknown protocol:" >< return_val) audit(AUDIT_INST_VER_NOT_VULN, appname, version);
else if ("Welcome" >!< return_val) audit(AUDIT_RESP_BAD, res[1]);

if (report_verbosity > 0)
{    
  report =
      '\n  Port              : ' + item[1] +
      '\n  Product           : ' + appname +
      '\n  Installed version : ' + version +
      '\n  Fixed version     : ' + fixed +
      '\n';
  security_hole(port: item[1], extra: report);
}
else security_hole(item[1]);
exit(0);

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

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

Go back to menu.

How to Run


Here is how to run the Jenkins < 1.638 / 1.625.2 Java Object Deserialization RCE 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 General plugin family.
  6. On the right side table select Jenkins < 1.638 / 1.625.2 Java Object Deserialization RCE plugin ID 86898.
  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 jenkins_security218.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

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

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

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

Go back to menu.

References


BID | SecurityFocus Bugtraq ID: CERT | Computer Emergency Response Team: See also: Similar and related Nessus plugins:
  • 119442 - RHEL 7 : openshift (RHSA-2016:0070)
  • 119368 - RHEL 6 : Red Hat OpenShift Enterprise 2.2.9 (RHSA-2016:0489)
  • 89725 - Jenkins < 1.642.2 / 1.650 Java Object Deserialization RCE
  • 89034 - Jenkins < 1.642.2 / 1.650 Java Object Deserialization RCE
  • 72685 - Jenkins < 1.551 / 1.532.2 and Jenkins Enterprise 1.509.x / 1.532.x < 1.509.5.1 / 1.532.2.2 Multiple Vulnerabilities
  • 78859 - Jenkins < 1.583 / 1.565.3 and Jenkins Enterprise 1.532.x / 1.554.x / 1.565.x < 1.532.10.1 / 1.554.10.1 / 1.565.3.1 Multiple Vulnerabilities
  • 89925 - Jenkins < 1.642.2 / 1.650 and Jenkins Enterprise < 1.609.16.1 / 1.625.16.1 / 1.642.2.1 Multiple Vulnerabilities
  • 111603 - Jenkins < 2.121.2 / 2.133 Multiple Vulnerabilities
  • 118147 - Jenkins < 2.138.2 (LTS) / 2.146 Multiple Vulnerabilities
  • 119500 - Jenkins < 2.138.4 LTS / 2.150.1 LTS / 2.154 Multiple Vulnerabilities
  • 127053 - Jenkins < 2.176.2 LTS / 2.186 Multiple Vulnerabilities
  • 130099 - Jenkins < 2.176.4 LTS / 2.197 Multiple Vulnerabilities
  • 139734 - Jenkins < 2.235.5 LTS / 2.243 Information Disclosure Vulnerability
  • 139726 - Jenkins < 2.235.4 LTS / 2.252 Multiple Cross-Site Scripting (XSS) Vulnerabilities
  • 148401 - Jenkins weekly < 2.280 Privilege Escalation
  • 148975 - Jenkins LTS < 2.277.3 / Jenkins weekly < 2.286
  • 151193 - Jenkins LTS < 2.289.2 / Jenkins weekly < 2.300 Multiple Vulnerabilities
  • 154055 - Jenkins LTS < 2.303.2 / Jenkins weekly < 2.315 Multiple Vulnerabilities
  • 156929 - Jenkins LTS < 2.319.2 / Jenkins weekly < 2.330 Multiple Vulnerabilities
  • 157860 - Jenkins LTS < 2.319.3 / Jenkins weekly < 2.334 Multiple Vulnerabilities
  • 99984 - Jenkins < 2.46.2 / 2.57 and Jenkins Enterprise < 1.625.24.1 / 1.651.24.1 / 2.7.24.0.1 / 2.46.2.1 Multiple Vulnerabilities
  • 153924 - Jenkins Git Plugin < 4.8.3 / Jenkins LTS < 2.303.2 / Jenkins weekly < 2.315 Multiple Vulnerabilities (Deprecated)
  • 97609 - Jenkins < 2.44 / 2.32.x < 2.32.2, Jenkins Operations Center < 1.625.22.1 / 2.7.22.0.1 / 2.32.2.1, and Jenkins Enterprise < 1.651.22.1 / 2.7.22.0.1 / 2.32.2.1 Multiple Vulnerabilities
  • 129169 - Jenkins Security Advisory 2019-01-08 Multiple Vulnerabilities
  • 155735 - Jenkins Plugins Multiple Vulnerabilities (Jenkins Security Advisory 2021-03-30)
  • 156930 - Jenkins plugins Multiple Vulnerabilities (2022-01-12)
  • 155587 - Jenkins Enterprise and Operations Center < 2.249.31.0.1 / 2.277.3.1 DoS (CloudBees Security Advisory 2021-04-20)
  • 153977 - Jenkins Enterprise and Operations Center < 2.249.31.0.6 / 2.277.40.0.1 / 2.289.2.2 Multiple Vulnerabilities (CloudBees Security Advisory 2021-06-30)
  • 153890 - Jenkins Enterprise and Operations Center < 2.249.32.0.2 / 2.277.41.0.2 / 2.303.1.6 Multiple Vulnerabilities (CloudBees Security Advisory 2021-08-31)
  • 155661 - Jenkins Enterprise and Operations Center < 2.249.33.0.1 / 2.277.42.0.1 / 2.303.2.5 Multiple Vulnerabilities (CloudBees Security Advisory 2021-10-06)
  • 158092 - Jenkins Enterprise and Operations Center < 2.277.43.0.3 / 2.319.1.5 Multiple Vulnerabilities (CloudBees Security Advisory 2021-12-01)
  • 158059 - Jenkins Enterprise and Operations Center < 2.277.43.0.5 / 2.319.2.5 Multiple Vulnerabilities (CloudBees Security Advisory 2022-01-12)
  • 158672 - Jenkins Enterprise and Operations Center 2.277.x < 2.277.43.0.6 / 2.303.x < 2.303.30.0.5 / 2.319.3.3 Multiple DoS (CloudBees Security Advisory 2022-02-09)

Version


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

Go back to menu.