Vulnerabilities > CVE-2015-5970 - Code Injection vulnerability in Novell Zenworks Configuration Management

047910
CVSS 5.3 - MEDIUM
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
LOW
Integrity impact
NONE
Availability impact
NONE
network
low complexity
novell
CWE-94
nessus

Summary

The ChangePassword RPC method in Novell ZENworks Configuration Management (ZCM) 11.3 and 11.4 allows remote attackers to conduct XPath injection attacks, and read arbitrary text files, via a malformed query involving a system entity reference.

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Leverage Executable Code in Non-Executable Files
    An attack of this type exploits a system's trust in configuration and resource files, when the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high. The attack can be directed at a client system, such as causing buffer overrun through loading seemingly benign image files, as in Microsoft Security Bulletin MS04-028 where specially crafted JPEG files could cause a buffer overrun once loaded into the browser. Another example targets clients reading pdf files. In this case the attacker simply appends javascript to the end of a legitimate url for a pdf (http://www.gnucitizen.org/blog/danger-danger-danger/) http://path/to/pdf/file.pdf#whatever_name_you_want=javascript:your_code_here The client assumes that they are reading a pdf, but the attacker has modified the resource and loaded executable javascript into the client's browser process. The attack can also target server processes. The attacker edits the resource or configuration file, for example a web.xml file used to configure security permissions for a J2EE app server, adding role name "public" grants all users with the public role the ability to use the administration functionality. The server trusts its configuration file to be correct, but when they are manipulated, the attacker gains full control.
  • Manipulating User-Controlled Variables
    This attack targets user controlled variables (DEBUG=1, PHP Globals, and So Forth). An attacker can override environment variables leveraging user-supplied, untrusted query variables directly used on the application server without any data sanitization. In extreme cases, the attacker can change variables controlling the business logic of the application. For instance, in languages like PHP, a number of poorly set default configurations may allow the user to override variables.

Nessus

NASL familyMisc.
NASL idNOVELL_ZENWORKS_XPATH_INJECTION.NASL
descriptionThe remote Novell ZENWworks Configuration Management (ZCM) server is affected by an information disclosure vulnerability in the ChangePassword RPC implementation that is triggered when handling malformed queries involving a system entity reference. An unauthenticated, remote attacker can exploit this, via XPath injection, to read arbitrary text files.
last seen2020-06-01
modified2020-06-02
plugin id88982
published2016-02-26
reporterThis script is Copyright (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
sourcehttps://www.tenable.com/plugins/nessus/88982
titleNovell ZENworks ChangePassword RPC XPath Injection
code
#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

if (description)
{
  script_id(88982);
  script_version("1.6");
  script_cvs_date("Date: 2019/11/20");

  script_cve_id("CVE-2015-5970");
  script_bugtraq_id(83238);
  script_xref(name:"ZDI", value:"ZDI-16-167");

  script_name(english:"Novell ZENworks ChangePassword RPC XPath Injection");
  script_summary(english:"Sends ChangePassword requests to exercise XPath injection.");

  script_set_attribute(attribute:"synopsis", value:
"The remote ZENworks server is affected by an information disclosure
vulnerability.");
  script_set_attribute(attribute:"description", value:
"The remote Novell ZENWworks Configuration Management (ZCM) server is
affected by an information disclosure vulnerability in the
ChangePassword RPC implementation that is triggered when handling
malformed queries involving a system entity reference. An
unauthenticated, remote attacker can exploit this, via XPath
injection, to read arbitrary text files.");
  script_set_attribute(attribute:"see_also", value:"https://www.zerodayinitiative.com/advisories/ZDI-16-167/");
  script_set_attribute(attribute:"see_also", value:"https://support.microfocus.com/kb/doc.php?id=7017240");
  script_set_attribute(attribute:"solution", value:
"Apply the patch provided by Micro Focus.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:N/A:N");
  script_set_cvss_temporal_vector("CVSS2#E:U/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:N/A:N");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:U/RL:O/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2015-5970");

  script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"false");

  script_set_attribute(attribute:"vuln_publication_date", value:"2016/02/10");
  script_set_attribute(attribute:"patch_publication_date", value:"2016/02/10");
  script_set_attribute(attribute:"plugin_publication_date", value:"2016/02/26");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:novell:zenworks_configuration_management");
  script_end_attributes();

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

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

  script_dependencies("novell_zenworks_control_center_detect.nasl");
  script_require_keys("www/zenworks_control_center");
  script_require_ports("Services/www", 443);

  exit(0);
}

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

appname = "Novell ZENworks Control Center";
port = get_http_port(default:443);
install = get_install_from_kb(
  appname:"zenworks_control_center",
  port:port,
  exit_on_fail:TRUE);

##
# POSTs a message to the ChangePassword URL and examines the response
# provided by the server. Unexpected responses will result in an audit.
# @data the HTTP payload
# @expected_status the expected status description embedded in the returned XML
# @expected_number the expected HTTP status embedded in the returned XML
##
function query_zenworks(data, expected_status, expected_number)
{
  local_var res = http_send_recv3(
    method:"POST",
    item:"/CasaAuthTokenSvc/Rpc?method=ChangePassword",
    port:port,
    data:data,
    content_type:"text/xml",
    exit_on_fail:TRUE);

  if (isnull(res[0]) || isnull(res[2])) audit(AUDIT_RESP_BAD, port);
  if (res[0] != 'HTTP/1.1 200 OK\r\n') audit(AUDIT_INST_VER_NOT_VULN, appname);
  local_var match = eregmatch(
    pattern:"<status><description>([a-zA-Z ]+)</description>([1-9]00)</status>",
    string: res[2]);

  if (isnull(match) ||
      match[1] != expected_status ||
      match[2] != expected_number) audit(AUDIT_INST_VER_NOT_VULN, appname);
}

# check to see if XPath injection is possible.
data = 
  '<?xml version="1.0" encoding="UTF-8"?>\n'+
  '<change_password_req>\n' +
    '<realm>\'nessus</realm>\n' +
    '<username>Nessus</username>\n' +
    '<old_token>dGVzdA==</old_token>\n' +
    '<new_token>dGVzdA==</new_token>\n' +
  '</change_password_req>';

query_zenworks(data:data, expected_status:"Internal Server Error", expected_number:"500");


# If we got here than the above broke the XPath query in
# some way. The following will determine if Zenworks has
# the patch the detects XPath injection
data = 
  '<?xml version="1.0" encoding="UTF-8"?>\n'+
  '<change_password_req>\n' +
    '<realm>nessus()=[]:,*/</realm>\n' +
    '<username>Nessus</username>\n' +
    '<old_token>dGVzdA==</old_token>\n' +
    '<new_token>dGVzdA==</new_token>\n' +
  '</change_password_req>';

query_zenworks(data:data, expected_status:"OK", expected_number:"200");

report = '\nNessus was able to use characters associated with XPath injection' +
  '\nin a ChangePassword request.';
security_report_v4(port:port, severity:SECURITY_WARNING, extra:report);