Atlassian Confluence < 6.6.12 / 6.7.x < 6.12.3 / 6.13.x < 6.13.3 / 6.14.x < 6.14.2 Template Injection - Nessus

Critical   Plugin ID: 124004

This page contains detailed information about the Atlassian Confluence < 6.6.12 / 6.7.x < 6.12.3 / 6.13.x < 6.13.3 / 6.14.x < 6.14.2 Template Injection Nessus plugin including available exploits and PoCs found on GitHub, in Metasploit or Exploit-DB for verifying of this vulnerability.

Plugin Overview


ID: 124004
Name: Atlassian Confluence < 6.6.12 / 6.7.x < 6.12.3 / 6.13.x < 6.13.3 / 6.14.x < 6.14.2 Template Injection
Filename: confluence_cve-2019-3396.nasl
Vulnerability Published: 2019-03-20
This Plugin Published: 2019-04-11
Last Modification Time: 2022-04-11
Plugin Version: 1.12
Plugin Type: remote
Plugin Family: CGI abuses
Dependencies: confluence_detect.nasl
Required KB Items [?]: installed_sw/confluence

Vulnerability Information


Severity: Critical
Vulnerability Published: 2019-03-20
Patch Published: 2019-03-20
CVE [?]: CVE-2019-3396
CPE [?]: cpe:/a:atlassian:confluence
Exploited by Malware: True

Synopsis

A web application running on the remote host is affected by a template injection vulnerability.

Description

According to the tests performed by Nessus, the remote host is affected by the following vulnerability:

- A server-side template injection exists in the Widget Connector due to improper input validation. An attacker can exploit this, via unspecified vectors, to traverse directories or execute arbitrary code. (CVE-2019-3396)

Solution

Upgrade to Atlassian Confluence version 6.6.12, 6.12.3, 6.13.3, 6.14.2, 6.15.1 or later.

Public Exploits


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

Here's the list of publicly known exploits and PoCs for verifying the Atlassian Confluence < 6.6.12 / 6.7.x < 6.12.3 / 6.13.x < 6.13.3 / 6.14.x < 6.14.2 Template Injection vulnerability:

  1. Metasploit: exploit/multi/http/confluence_widget_connector
    [Atlassian Confluence Widget Connector Macro Velocity Template Injection]
  2. Exploit-DB: exploits/multiple/remote/46731.rb
    [EDB-46731: Atlassian Confluence Widget Connector Macro - Velocity Template Injection (Metasploit)]
  3. Exploit-DB: exploits/multiple/webapps/49465.py
    [EDB-49465: Atlassian Confluence Widget Connector Macro - SSTI]
  4. GitHub: https://github.com/0ps/pocassistdb
    [CVE-2019-3396]
  5. GitHub: https://github.com/46o60/CVE-2019-3396_Confluence
    [CVE-2019-3396]
  6. GitHub: https://github.com/BitTheByte/Eagle
    [CVE-2019-3396]
  7. GitHub: https://github.com/FDlucifer/firece-fish
    [CVE-2019-3396]
  8. GitHub: https://github.com/Metarget/metarget
    [CVE-2019-3396]
  9. GitHub: https://github.com/PetrusViet/cve-2019-3396
    [CVE-2019-3396: Confluence unauthorize template injection]
  10. GitHub: https://github.com/SexyBeast233/SecBooks
    [CVE-2019-3396]
  11. GitHub: https://github.com/abdallah-elsharif/cve-2019-3396
    [CVE-2019-3396]
  12. GitHub: https://github.com/alex14324/Eagel
    [CVE-2019-3396]
  13. GitHub: https://github.com/am6539/CVE-2019-3396
    [CVE-2019-3396]
  14. GitHub: https://github.com/amcai/myscan
    [CVE-2019-3396]
  15. GitHub: https://github.com/jandersoncampelo/InfosecBookmarks
    [CVE-2019-3396]
  16. GitHub: https://github.com/jas502n/CVE-2019-3394
    [CVE-2019-3396]
  17. GitHub: https://github.com/jweny/pocassistdb
    [CVE-2019-3396]
  18. GitHub: https://github.com/koamania/confluence_ssrf_malware_cleaner
    [CVE-2019-3396]
  19. GitHub: https://github.com/mntn0x/POC
    [CVE-2019-3396]
  20. GitHub: https://github.com/r0eXpeR/supplier
    [CVE-2019-3396]
  21. GitHub: https://github.com/s1xg0d/CVE-2019-3396
    [CVE-2019-3396]
  22. GitHub: https://github.com/tdcoming/Vulnerability-engine
    [CVE-2019-3396]
  23. GitHub: https://github.com/underattack-today/underattack-py
    [CVE-2019-3396]
  24. GitHub: https://github.com/woods-sega/woodswiki
    [CVE-2019-3396]
  25. GitHub: https://github.com/xiaoshuier/CVE-2019-3396
    [CVE-2019-3396]
  26. GitHub: https://github.com/zhengjim/loophole
    [CVE-2019-3396]
  27. GitHub: https://github.com/dothanthitiendiettiende/CVE-2019-3396
    [CVE-2019-3396: Confluence Widget Connector RCE]
  28. GitHub: https://github.com/jas502n/CVE-2019-3396
    [CVE-2019-3396: Confluence 未授权 RCE (CVE-2019-3396) 漏洞]
  29. GitHub: https://github.com/JonathanZhou348/CVE-2019-3396TEST
    [CVE-2019-3396: TEST]
  30. GitHub: https://github.com/pyn3rd/CVE-2019-3396
    [CVE-2019-3396: Confluence Widget Connector RCE]
  31. GitHub: https://github.com/quanpt103/CVE-2019-3396
    [CVE-2019-3396: Confluence Widget Connector RCE - ptquan]
  32. GitHub: https://github.com/skommando/CVE-2019-3396-confluence-poc
    [CVE-2019-3396: CVE-2019-3396 漏洞验证txt与模板文件。]
  33. GitHub: https://github.com/vntest11/confluence_CVE-2019-3396
    [CVE-2019-3396: Confluence Widget Connector path traversal (CVE-2019-3396)]
  34. GitHub: https://github.com/W2Ning/CVE-2019-3396
    [CVE-2019-3396: For test]
  35. GitHub: https://github.com/x-f1v3/CVE-2019-3396
    [CVE-2019-3396: Confluence Widget Connector path traversal (CVE-2019-3396)]
  36. GitHub: https://github.com/Yt1g3r/CVE-2019-3396_EXP
    [CVE-2019-3396: CVE-2019-3396 confluence SSTI RCE]
  37. GitHub: https://github.com/yuehanked/cve-2019-3396
    [CVE-2019-3396: Windows.vm]
  38. GitHub: https://github.com/tanw923/test1
    [CVE-2019-3396: https://github.com/Yt1g3r/CVE-2019-3396_EXP.git]
  39. D2 Elliot: confluence_file_disclosure.html
    [Confluence File Disclosure]
  40. 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-2019-3396
CVSS V2 Vector: AV:N/AC:L/Au:N/C:C/I:C/A:C/E:H/RL:OF/RC:C
CVSS Base Score:10.0 (High)
Impact Subscore:10.0
Exploitability Subscore:10.0
CVSS Temporal Score:8.7 (High)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:8.7 (High)
CVSS V3 Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:H/RL:O/RC:C
CVSS Base Score:9.8 (Critical)
Impact Subscore:5.9
Exploitability Subscore:3.9
CVSS Temporal Score:9.4 (Critical)
CVSS Environmental Score:NA (None)
Modified Impact Subscore:NA
Overall CVSS Score:9.4 (Critical)
STIG Severity [?]: I
STIG Risk Rating: High

Go back to menu.

Plugin Source


This is the confluence_cve-2019-3396.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(124004);
  script_version("1.12");
  script_set_attribute(attribute:"plugin_modification_date", value:"2022/04/11");

  script_cve_id("CVE-2019-3396");
  script_xref(name:"IAVA", value:"2019-A-0135-S");
  script_xref(name:"CISA-KNOWN-EXPLOITED", value:"2022/05/03");

  script_name(english:"Atlassian Confluence < 6.6.12 / 6.7.x < 6.12.3 / 6.13.x < 6.13.3 / 6.14.x < 6.14.2 Template Injection");

  script_set_attribute(attribute:"synopsis", value:
"A web application running on the remote host is affected by
a template injection vulnerability.");
  script_set_attribute(attribute:"description", value:
"According to the tests performed by Nessus, the remote host
is affected by the following vulnerability:

  - A server-side template injection exists in the Widget
    Connector due to improper input validation. An attacker
    can exploit this, via unspecified vectors, to traverse
    directories or execute arbitrary code. (CVE-2019-3396)");
  # https://confluence.atlassian.com/doc/confluence-security-advisory-2019-03-20-966660264.html
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?b8e8304c");
  script_set_attribute(attribute:"solution", value:
"Upgrade to Atlassian Confluence version 6.6.12, 6.12.3, 6.13.3,
6.14.2, 6.15.1 or later.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:C");
  script_set_cvss_temporal_vector("CVSS2#E:H/RL:OF/RC:C");
  script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:H/RL:O/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2019-3396");

  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:"d2_elliot_name", value:"Confluence File Disclosure");
  script_set_attribute(attribute:"exploit_framework_d2_elliot", value:"true");
  script_set_attribute(attribute:"exploited_by_malware", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'Atlassian Confluence Widget Connector Macro Velocity Template Injection');
  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:"2019/03/20");
  script_set_attribute(attribute:"patch_publication_date", value:"2019/03/20");
  script_set_attribute(attribute:"plugin_publication_date", value:"2019/04/11");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:atlassian:confluence");
  script_set_attribute(attribute:"stig_severity", value:"I");
  script_set_attribute(attribute:"thorough_tests", value:"true");
  script_end_attributes();

  script_category(ACT_ATTACK);
  script_family(english:"CGI abuses");

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

  script_dependencies("confluence_detect.nasl");
  script_require_keys("installed_sw/confluence");
  script_require_ports("Services/www", 8080, 8090);

  exit(0);
}

include('vcf.inc');
include('http.inc');

app_name = 'confluence';

port = get_http_port(default:8090);

app_info = vcf::get_app_info(app:app_name, port:port, webapp:true);
path = app_info['path'];
if(path[strlen(path)-1] != '/') path += '/';

item   =  path + 'rest/tinymce/1/macro/preview';
header = {'Content-Type':'application/json','User-Agent':''};
data   = '{"contentId":"1337","macro":{"name":"widget","body":"","params":' +
         '{"url":"http://localhost//www.youtube.com/watch?v=w0gtNxBWIEY","width":"1000","height":"1000","_template":"../web.xml"}}}';

res = http_send_recv3(method:'POST', item:item, port:port, add_headers:header, data:data, exit_on_fail:TRUE);

if('</web-app>' >< res[2])
  security_report_v4(severity:SECURITY_HOLE, port:port, generic:TRUE, request:[http_last_sent_request()]);
else
  audit(AUDIT_WEB_APP_NOT_AFFECTED, 'Atlassian Confluence', build_url(qs:path, port:port));

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

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

Go back to menu.

How to Run


Here is how to run the Atlassian Confluence < 6.6.12 / 6.7.x < 6.12.3 / 6.13.x < 6.13.3 / 6.14.x < 6.14.2 Template Injection 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 CGI abuses plugin family.
  6. On the right side table select Atlassian Confluence < 6.6.12 / 6.7.x < 6.12.3 / 6.13.x < 6.13.3 / 6.14.x < 6.14.2 Template Injection plugin ID 124004.
  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 confluence_cve-2019-3396.nasl -t <IP/HOST>

Run the plugin with audit trail message on the console:

/opt/nessus/bin/nasl -a confluence_cve-2019-3396.nasl -t <IP/HOST>

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

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

Go back to menu.

References


IAVA | Information Assurance Vulnerability Alert:
  • 2019-A-0135-S
See also: Similar and related Nessus plugins:
  • 123008 - Atlassian Confluence < 6.6.12 / 6.7.x < 6.12.3 / 6.13.x < 6.13.3 / 6.14.x < 6.14.2 Multiple Vulnerabilities
  • 110771 - Atlassian Confluence < 6.1.3 OAuth Plugin IconUriServlet Internal Network Resource Disclosure CSRF
  • 124281 - Atlassian Confluence < 6.6.13 / 6.7.x < 6.12.4 / 6.13.x < 6.13.4 / 6.14.x < 6.14.3 / 6.15.x < 6.15.2 Directory Traversal Vulnerability
  • 128548 - Atlassian Confluence 6.1.x < 6.6.16 / 6.7.x < 6.13.7 / 6.14.x < 6.15.8 Local File Disclosure Vulnerability
  • 152864 - Atlassian Confluence < 6.13.23 / 6.14 < 7.4.11 / 7.5 < 7.11.6 / 7.12 < 7.12.5 Webwork OGNL Injection (CONFSERVER-67940)
  • 153087 - Atlassian Confluence Server Webwork OGNL Injection (CVE-2021-26084)
  • 154244 - Atlassian Confluence Server Arbitrary File Read (CVE-2021-26085)

Version


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

Go back to menu.