Vulnerabilities > CVE-2016-1454 - Improper Input Validation vulnerability in Cisco Nx-Os

047910
CVSS 7.1 - HIGH
Attack vector
NETWORK
Attack complexity
MEDIUM
Privileges required
NONE
Confidentiality impact
NONE
Integrity impact
NONE
Availability impact
COMPLETE
network
cisco
CWE-20
nessus

Summary

Cisco NX-OS 4.0 through 7.3 and 11.0 through 11.2 on 1000v, 2000, 3000, 3500, 5000, 5500, 5600, 6000, 7000, 7700, and 9000 devices allows remote attackers to cause a denial of service (device reload) by leveraging a peer relationship to send a crafted BGP UPDATE message, aka Bug IDs CSCuq77105 and CSCux11417.

Vulnerable Configurations

Part Description Count
OS
Cisco
425
Hardware
Cisco
53

Common Weakness Enumeration (CWE)

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Buffer Overflow via Environment Variables
    This attack pattern involves causing a buffer overflow through manipulation of environment variables. Once the attacker finds that they can modify an environment variable, they may try to overflow associated buffers. This attack leverages implicit trust often placed in environment variables.
  • Server Side Include (SSI) Injection
    An attacker can use Server Side Include (SSI) Injection to send code to a web application that then gets executed by the web server. Doing so enables the attacker to achieve similar results to Cross Site Scripting, viz., arbitrary code execution and information disclosure, albeit on a more limited scale, since the SSI directives are nowhere near as powerful as a full-fledged scripting language. Nonetheless, the attacker can conveniently gain access to sensitive files, such as password files, and execute shell commands.
  • Cross Zone Scripting
    An attacker is able to cause a victim to load content into their web-browser that bypasses security zone controls and gain access to increased privileges to execute scripting code or other web objects such as unsigned ActiveX controls or applets. This is a privilege elevation attack targeted at zone-based web-browser security. In a zone-based model, pages belong to one of a set of zones corresponding to the level of privilege assigned to that page. Pages in an untrusted zone would have a lesser level of access to the system and/or be restricted in the types of executable content it was allowed to invoke. In a cross-zone scripting attack, a page that should be assigned to a less privileged zone is granted the privileges of a more trusted zone. This can be accomplished by exploiting bugs in the browser, exploiting incorrect configuration in the zone controls, through a cross-site scripting attack that causes the attackers' content to be treated as coming from a more trusted page, or by leveraging some piece of system functionality that is accessible from both the trusted and less trusted zone. This attack differs from "Restful Privilege Escalation" in that the latter correlates to the inadequate securing of RESTful access methods (such as HTTP DELETE) on the server, while cross-zone scripting attacks the concept of security zones as implemented by a browser.
  • Cross Site Scripting through Log Files
    An attacker may leverage a system weakness where logs are susceptible to log injection to insert scripts into the system's logs. If these logs are later viewed by an administrator through a thin administrative interface and the log data is not properly HTML encoded before being written to the page, the attackers' scripts stored in the log will be executed in the administrative interface with potentially serious consequences. This attack pattern is really a combination of two other attack patterns: log injection and stored cross site scripting.
  • Command Line Execution through SQL Injection
    An attacker uses standard SQL injection methods to inject data into the command line for execution. This could be done directly through misuse of directives such as MSSQL_xp_cmdshell or indirectly through injection of data into the database that would be interpreted as shell commands. Sometime later, an unscrupulous backend application (or could be part of the functionality of the same application) fetches the injected data stored in the database and uses this data as command line arguments without performing proper validation. The malicious data escapes that data plane by spawning new commands to be executed on the host.

Nessus

NASL familyCISCO
NASL idCISCO-SA-20161005-BGP.NASL
descriptionAccording to its self-reported version, a denial of service (DoS) vulnerability exists in the Border Gateway Protocol (BGP) implementation of Cisco NX-OS System Software due to incomplete input validation of BGP update messages. An unauthenticated, remote attacker can exploit this issue, by sending a crafted BGP update message to the targeted device, to cause the switch to reload unexpectedly. As the Cisco implementation of the BGP protocol only accepts incoming BGP traffic from explicitly defined peers, an attacker must be able to send the malicious packets over a TCP connection that appears to come from a trusted BGP peer or be able to inject malformed messages into the victim
last seen2020-06-01
modified2020-06-02
plugin id130597
published2019-11-07
reporterThis script is Copyright (C) 2019 and is owned by Tenable, Inc. or an Affiliate thereof.
sourcehttps://www.tenable.com/plugins/nessus/130597
titleCisco NX-OS Border Gateway Protocol DoS (cisco-sa-20161005-bgp)
code
#TRUSTED 761ad8447d21695ad56453251d28a78923501640f73342048acd2a68ae8f65c4c5fb2992436ef2ce591afe1faf5f57068a94cc98db5d312f5c9f7c1736590a3013aaa967033805963d180ead8c0db524e42b7632a9f8c79ea3035567d07550291dd417295ec3cf140f963d4e20df23e6d2c18233a39e064627db427ea2db100a3bf52149aee9ca20ae345d2eff5517a399717ff5d7cff55aa5a38eee843fe3e52d3fafc21a5227be04962b446b5afa02ab5e9530206e61303cc0b8f79e731b31258f1d44457b29203915d42e4817d00b587ee09d1d4845fc1b4b273a9c82d3c3edf2fa32fc6cceee57318a3bc78384d80fad8703d1d331648bb3ce9fa8f5c5e464132a77df3ba25994903af33d4b6fa9290c7edafbd273f2c961980e40d2d208e7fd9e34d4fcdeba4e552b5027dacac3ea2d40d5ac69a6fa253d520701dd30c2b36656e281453a7b53e63dca485b4f23ae7b3d42e422a7b694c71351514d9e48a9de5fd4b117127d131536d0753a96ce3d68f403b8165b7c80523b02eb03c9bb6638950deb87dac363f03e9f54999ae1e371e50b8750e44c10c2266af4d9366cb25154d85977e996f53a2504a6e2bc12ffd458f19c0e7ed12977b28769f4994c2c4e17c7e50645c6d6214f10ffc21b3caee78d23ef2ffe56f8f2a3a92a4b0ea1c8673105ae60a0a6ce83b23fcc532fa6f6d4395c0208f9872cf31d964fc458c9
#
# (C) Tenable Network Security, Inc.
#

include('compat.inc');

if (description)
{
  script_id(130597);
  script_version("1.4");
  script_cvs_date("Date: 2019/11/08");

  script_cve_id("CVE-2016-1454");
  script_bugtraq_id(93417);
  script_xref(name:"CISCO-BUG-ID", value:"CSCuq77105");
  script_xref(name:"CISCO-BUG-ID", value:"CSCux11417");
  script_xref(name:"CISCO-SA", value:"cisco-sa-20161005-bgp");

  script_name(english:"Cisco NX-OS Border Gateway Protocol DoS (cisco-sa-20161005-bgp)");
  script_summary(english:"Checks the version of Cisco NX-OS Software");

  script_set_attribute(attribute:"synopsis", value:
"The remote device is missing a vendor-supplied security patch");
  script_set_attribute(attribute:"description", value:
"According to its self-reported version, a denial of service (DoS) vulnerability exists in the Border Gateway Protocol
(BGP) implementation of Cisco NX-OS System Software due to incomplete input validation of BGP update messages. An
unauthenticated, remote attacker can exploit this issue, by sending a crafted BGP update message to the targeted device,
to cause the switch to reload unexpectedly. As the Cisco implementation of the BGP protocol only accepts incoming BGP
traffic from explicitly defined peers, an attacker must be able to send the malicious packets over a TCP connection
that appears to come from a trusted BGP peer or be able to inject malformed messages into the victim's BGP network.
This vulnerability can only be triggered when the router receives a malformed BGP message from a peer on an existing
BGP session, so at least one BGP neighbor session must be established for a router to be vulnerable.

This vulnerability is not remotely exploitable if all BGP peers to the NX-OS Software are Cisco IOS, IOS-XE, or IOS-XR
device and those device are not configured for Cisco Multicast VPN (MVPN) interautonomous system support.

Note that Nessus has not tested for this issue but has instead relied only on the application's self-reported version
number.");
  # https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20161005-bgp
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?3be03020");
  script_set_attribute(attribute:"see_also", value:"https://bst.cloudapps.cisco.com/bugsearch/bug/CSCuq77105");
  script_set_attribute(attribute:"see_also", value:"https://bst.cloudapps.cisco.com/bugsearch/bug/CSCux11417");
  script_set_attribute(attribute:"solution", value:
"Upgrade to the relevant fixed version referenced in Cisco bug IDs CSCuq77105 or CSCux11417.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:N/I:N/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:N/UI:R/S:U/C:N/I:N/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-1454");

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

  script_set_attribute(attribute:"vuln_publication_date", value:"2016/10/05");
  script_set_attribute(attribute:"patch_publication_date", value:"2016/10/05");
  script_set_attribute(attribute:"plugin_publication_date", value:"2019/11/07");

  script_set_attribute(attribute:"plugin_type", value:"combined");
  script_set_attribute(attribute:"cpe", value:"cpe:/o:cisco:nx-os");
  script_end_attributes();

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

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

  script_dependencies("cisco_nxos_version.nasl");
  script_require_keys("Host/Cisco/NX-OS/Version", "Host/Cisco/NX-OS/Device", "Host/Cisco/NX-OS/Model");

  exit(0);
}

include('audit.inc');
include('global_settings.inc');
include('cisco_workarounds.inc');
include('ccf.inc');

get_kb_item_or_exit('Host/Cisco/NX-OS/Device');
get_kb_item_or_exit('Host/Cisco/NX-OS/Model');

product_info = cisco::get_product_info(name:'Cisco NX-OS Software');
product_info.version = toupper(product_info.version);
product_info.model = toupper(product_info.model);

if ('Nexus' >!< product_info.device)
  audit(AUDIT_DEVICE_NOT_VULN, product_info.device);

# Don't check for ([^0-9]|$) at the end of the regex because, according to the Cisco Software Download pages, for
# example, Nexus 9000 Series Switches includes the 92300YC switch.
if (product_info.model =~ '^10[0-9]{2}V')
  vuln_ranges = [
    {'min_ver' : '0.0', 'fix_ver' : '5.2(1)SV3(1.15)'}
  ];
else if (product_info.model =~ '^30[0-9]{2}')
  vuln_ranges = [
    {'min_ver' : '0.0', 'fix_ver' : '6.0(2)U6(7)'},
    {'min_ver' : '6.1', 'fix_ver' : '7.0(3)I2(2E)'}
  ];
else if (product_info.model =~ '^35[0-9]{2}')
  vuln_ranges = [
    {'min_ver' : '0.0', 'fix_ver' : '6.0(2)A6(8)'}
  ];
else if (product_info.model =~ '^50[0-9]{2}')
  vuln_ranges = [
    # Advisory says prior to 5.2 and 5.2 are affected with no fix available, so passing 5.3 as the fixed version
    {'min_ver' : '0.0', 'fix_ver' : '5.3'}
  ];
else if (product_info.model =~ '^[26]0[0-9]{2}' ||
         product_info.model =~ '^5[56][0-9]{2}')
  vuln_ranges = [
    {'min_ver' : '0.0', 'fix_ver' : '7.1(1)N1(1)'},
    {'min_ver' : '7.2', 'fix_ver' : '7.2(0)N1(1)'},
    {'min_ver' : '7.3', 'fix_ver' : '7.3(0)N1(1)'}
  ];
else if (product_info.model =~ '^7[07][0-9]{2}')
  vuln_ranges = [
    {'min_ver' : '0.0', 'fix_ver' : '6.2(10)'},
    {'min_ver' : '7.2', 'fix_ver' : '7.2(0)D1(1)'},
    {'min_ver' : '7.3', 'fix_ver' : '7.3(0)D1(1)'}
  ];
else if (product_info.model =~ '^90[0-9]{2}')
{
  # We need to distinguish between Nexus 9000 Series Switches in ACI vs. NX-OS mode. From the Cisco Software Download
  # pages, it looks like ACI mode versions are always formatted like ab.c(dA) where abcd are integers and A is any
  # letter of the alphabet. NX-OS versions are never formatted like this.
  if (pregmatch(icase:TRUE, pattern: "[0-9]+\.[0-9]+\([0-9]+[A-Z]+\)", string:product_info.version))
    # ACI mode
    vuln_ranges = [
      {'min_ver' : '11.0', 'fix_ver' : '11.1(1J)'}
    ];
  else
    # NX-OS mode
    vuln_ranges = [
      {'min_ver' : '6.1', 'fix_ver' : '7.0(3)I2(2E)'}
    ];
}
else
  audit(AUDIT_HOST_NOT, 'vulnerable');

workarounds = make_list(CISCO_WORKAROUNDS['nxos_bgp_neighbor']);
workaround_params = make_list();

reporting = make_array(
  'port'     , 0,
  'severity' , SECURITY_HOLE,
  'version'  , product_info['version'],
  'bug_id'   , cbi
);

cisco::check_and_report(product_info:product_info, workarounds:workarounds, workaround_params:workaround_params, reporting:reporting, vuln_ranges:vuln_ranges, switch_only:TRUE);