Vulnerabilities > CVE-2016-1335 - Permissions, Privileges, and Access Controls vulnerability in Cisco ASR 5000 Series Software

047910
CVSS 7.1 - HIGH
Attack vector
NETWORK
Attack complexity
HIGH
Privileges required
SINGLE
Confidentiality impact
COMPLETE
Integrity impact
COMPLETE
Availability impact
COMPLETE
network
high complexity
cisco
CWE-264
nessus

Summary

The SSH implementation in Cisco StarOS before 19.3.M0.62771 and 20.x before 20.0.M0.62768 on ASR 5000 devices mishandles a multi-user public-key authentication configuration, which allows remote authenticated users to gain privileges by establishing a connection from an endpoint that was previously used for an administrator's connection, aka Bug ID CSCux22492.

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Accessing, Modifying or Executing Executable Files
    An attack of this type exploits a system's configuration that allows an attacker to either directly access an executable file, for example through shell access; or in a possible worst case allows an attacker to upload a file and then execute it. Web servers, ftp servers, and message oriented middleware systems which have many integration points are particularly vulnerable, because both the programmers and the administrators must be in synch regarding the interfaces and the correct privileges for each interface.
  • 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.
  • Blue Boxing
    This type of attack against older telephone switches and trunks has been around for decades. A tone is sent by an adversary to impersonate a supervisor signal which has the effect of rerouting or usurping command of the line. While the US infrastructure proper may not contain widespread vulnerabilities to this type of attack, many companies are connected globally through call centers and business process outsourcing. These international systems may be operated in countries which have not upgraded Telco infrastructure and so are vulnerable to Blue boxing. Blue boxing is a result of failure on the part of the system to enforce strong authorization for administrative functions. While the infrastructure is different than standard current applications like web applications, there are historical lessons to be learned to upgrade the access control for administrative functions.
  • Restful Privilege Elevation
    Rest uses standard HTTP (Get, Put, Delete) style permissions methods, but these are not necessarily correlated generally with back end programs. Strict interpretation of HTTP get methods means that these HTTP Get services should not be used to delete information on the server, but there is no access control mechanism to back up this logic. This means that unless the services are properly ACL'd and the application's service implementation are following these guidelines then an HTTP request can easily execute a delete or update on the server side. The attacker identifies a HTTP Get URL such as http://victimsite/updateOrder, which calls out to a program to update orders on a database or other resource. The URL is not idempotent so the request can be submitted multiple times by the attacker, additionally, the attacker may be able to exploit the URL published as a Get method that actually performs updates (instead of merely retrieving data). This may result in malicious or inadvertent altering of data on the server.
  • Target Programs with Elevated Privileges
    This attack targets programs running with elevated privileges. The attacker would try to leverage a bug in the running program and get arbitrary code to execute with elevated privileges. For instance an attacker would look for programs that write to the system directories or registry keys (such as HKLM, which stores a number of critical Windows environment variables). These programs are typically running with elevated privileges and have usually not been designed with security in mind. Such programs are excellent exploit targets because they yield lots of power when they break. The malicious user try to execute its code at the same level as a privileged system call.

Nessus

NASL familyCISCO
NASL idCISCO-SA-20160218-ASR.NASL
descriptionThe remote Cisco ASR 5000 Series device is affected by a privilege escalation vulnerability in the SSH subsystem due to improper handling of multi-user public-key authentication. An authenticated, remote attacker can exploit this, by establishing a connection from an endpoint that was previously used for an administrator
last seen2020-06-01
modified2020-06-02
plugin id89051
published2016-03-01
reporterThis script is Copyright (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
sourcehttps://www.tenable.com/plugins/nessus/89051
titleCisco ASR 5000 Series StarOS SSH Subsystem Privilege Escalation (CSCux22492)
code
#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

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

  script_cve_id("CVE-2016-1335");
  script_bugtraq_id(83304);
  script_xref(name:"CISCO-BUG-ID", value:"CSCux22492");
  script_xref(name:"CISCO-SA", value:"cisco-sa-20160218-asr");

  script_name(english:"Cisco ASR 5000 Series StarOS SSH Subsystem Privilege Escalation (CSCux22492)");
  script_summary(english:"Checks the StarOS version.");

  script_set_attribute(attribute:"synopsis", value:
"The remote device is affected by a privilege escalation vulnerability.");
  script_set_attribute(attribute:"description", value:
"The remote Cisco ASR 5000 Series device is affected by a privilege
escalation vulnerability in the SSH subsystem due to improper handling
of multi-user public-key authentication. An authenticated, remote
attacker can exploit this, by establishing a connection from an
endpoint that was previously used for an administrator's connection,
to gain elevated privileges.");
  # https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20160218-asr
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?c0aab2ac");
  script_set_attribute(attribute:"see_also", value:"https://tools.cisco.com/bugsearch/bug/CSCux22492");
  script_set_attribute(attribute:"solution", value:
"Upgrade to the relevant fixed version referenced in Cisco bug ID
CSCux22492.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:H/Au:S/C:C/I:C/A:C");
  script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C");
  script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:U/RL:O/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2016-1335");

  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/18");
  script_set_attribute(attribute:"patch_publication_date", value:"2016/02/18");
  script_set_attribute(attribute:"plugin_publication_date", value:"2016/03/01");

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:cisco:staros");
  script_set_attribute(attribute:"cpe", value:"cpe:/h:cisco:asr_5000");
  script_end_attributes();

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

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

  script_dependencies("ssh_get_info.nasl");
  script_require_keys("Host/Cisco/ASR/Model", "Host/Cisco/StarOS");

  exit(0);
}

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

get_kb_item_or_exit("Host/Cisco/StarOS");

version  = get_kb_item_or_exit("Host/Cisco/StarOS/Version");
model   = get_kb_item_or_exit("Host/Cisco/ASR/Model");

major = NULL;
build = NULL;
fix = NULL;
train = NULL;
new_ver_style = TRUE;

# only affects ASR 5000 series systems
if (model !~ "^5\d{3}$")
  audit(AUDIT_DEVICE_NOT_VULN, 'The ASR ' + model);

# Normalize train characters
version= toupper(version);

# defensive check for the eregmatches below
if (version !~ "^[\d\.]+\([\d\.]+" &&
    version !~ "^[\d\.]+[A-Z]{1,2}\d+\.\d+$")
  audit(AUDIT_DEVICE_NOT_VULN, "ASR " + model, version);

# old style of versioning 15.0(5439), style change mid 16.1, making
# all of the old style versions fall into the vulnerable range.
if ("(" >< version)
{
  major = eregmatch(pattern:"^([\d\.]+)\(", string:version);

  if(!isnull(major))
  {
    major = major[1];

    build = eregmatch(pattern:"^[\d\.]+\(([\d\.]+)", string:version);
      if(!isnull(build))
      {
        build = build[1];
        new_ver_style = FALSE;

        # Set the train to an empty string, or it causes issues when
        # seeing if a patched version exists using NULL as the value
        train = '';
      }
      else
        exit(1, "Unable to extract build number.");
  }
  else
    exit(1, "Unable to extract version number.");
}
else
{
  # extract major, train, and build for new style
  extract = eregmatch(pattern:"^([\d\.]+)\.([A-Z]{1,2}\d+)\.(\d+)", string:version);
  if (!isnull(extract))
  {
    major = extract[1];
    train = extract[2];
    build = extract[3];
  }
}

# Defensive checking for versions that we haven't yet seen
if (new_ver_style &&
   (empty_or_null(major) || empty_or_null(train) || empty_or_null(build)))
  exit(1, "An error occurred during version extraction.");
else if (!new_ver_style &&
   (empty_or_null(major) || empty_or_null(build)))
  exit(1, "An error occurred during version extraction.");

# For old and new styles- all < 19.3 are vuln
if (ver_compare(ver:major, fix:"19.3", strict:FALSE) < 0 )
  fix = "19.3.M0.62771";

# Per the advisory
else if (major == "19.3" && train == "M0" && int(build) < 62771 )
  fix = "19.3.M0.62771";

# For trains that are not in the M0 series, all vuln, with exceptions
else if (major == "19.3" && train != "M0")
  fix = "19.3.M0.62771";

# Per the advisory
else if (major == "20.0" && train == "M0" && int(build) < 62768)
  fix = "20.0.M0.62768";

# For trains that are not in the M0 series, all vuln, with exceptions
else if (major == "20.0" && train != "M0")
  fix = "20.0.M0.62768";

# These are all of the explicitly mentioned fixes, which are the exceptions
# in the trains that are not the M0 series.
known_fixes = make_array(
    "19.3", make_array( "A0", make_list("62430", "62460"),
                        "M0", make_list("62410", "62456", "62726", "62771"),
                        "T0", make_list("62421", "62463", "62725")
                      ),
    "20.0", make_array( "M0",  make_list("62373", "62453", "62480", "62490",
                                         "62492", "62724", "62748", "62792"),
                        "R0",  make_list("62757", "62808"),
                        "V0",  make_list("62729", "62707"),
                        "VC0", make_list("62385", "62464", "62510")
                      )
    );

# Check to see if there is a list if fixed builds for the major version and
# associated train.
if (fix && !is_list(known_fixes[major][train]))
{
  # Iterate through all of the fixed builds for each train, if one is found
  # then we are not vulnerable and we want to audit out.
  foreach fix_build (known_fixes[major][train])
    if (fix_build == build)
      fix = FALSE;
}

if (fix)
{
    report =
      '\n  Model             : ASR ' + model +
      '\n  Installed version : ' + version +
      '\n  Fixed version     : ' + fix +
      '\n';

  security_report_v4(port:0, extra:report, severity:SECURITY_HOLE);
  exit(0);
}
else
  audit(AUDIT_DEVICE_NOT_VULN, "ASR " + model, version);