Cisco NX-OS Software Cisco Fabric Services Arbitrary Code Execution (cisco-sa-20180620-fxnxos-ace)

2020-07-14T00:00:00
ID CISCO-SA-20180620-NXOS-ACE.NASL
Type nessus
Reporter This script is Copyright (C) 2020 and is owned by Tenable, Inc. or an Affiliate thereof.
Modified 2020-07-14T00:00:00

Description

A arbitrary code execution vulnerability exists in Cisco Fabric Services NXOS software due to insufficient validation of packet headers. An unauthenticated, remote attacker can exploit this, via crafted packets, to execute arbitrary code.

Please see the included Cisco BIDs and Cisco Security Advisory for more information.

                                        
                                            #TRUSTED 255c56b7d2afafc23f74d893844ec45c038d9552400b90de994b68be9d3d9ae54b856d409e97c7007a677ee8df251eecec5e03d22b2e5fb5e4136e46d98cbbfe5e8d187825d884b9647e7d51162a989417c4bc6b5177e4b6d6905f3c8cb1d366285f5f3861649d0a47752d568fb06e85869e365002951ff2c2e1bff6fe5f47016b88b301e3bb2015b612ecae96daf278400a6f559eb6f88db2fb15475c40e1d10c7e68055dd9f305059981e0f2b1637a03e3aa338cee16db9b02f7a0c844314d83e3879f258a5121027fc4f5a6b5f57b87205a5ddfd9bcd7301dcedf808de7d0145ec307c0c9069242f6579babe97928edbe219cd68d7bc0b68ee1721b04ca273a3bdb112053be412267f80de1aa73f8f69c93085656c0ee1c33572b9fed22924faa002e75ba34a53bd85d803c712ba7f39d3de250a494fcfa6764eb893dd117e7f7a551df15e80025695db4d5f419791aa0be7ba42d9112260f7599145636885c6c510908806871ae79d0c7c7ad7e0f711d39e20908d2f2e829bc63a0efa533191f50e926ed19cf076cdf123d2873cacbd052d86199873391ed9b5daf9ef78363f03489066727bafd7d2d4e711307d6af30543abbefdf1e04a7b994622dfa46ef1db9eae8302c877e568951335fae194a5ce95baf1993fa8079363d9924918f6890d1eae57a83e5543f3d13c00553929f17461c2cc6ca9e99da04164964cc7a
#
# (C) Tenable Network Security, Inc.
#

include('compat.inc');

if (description)
{
  script_id(138438);
  script_version("1.6");
  script_set_attribute(attribute:"plugin_modification_date", value:"2020/08/11");

  script_cve_id("CVE-2018-0304");
  script_bugtraq_id(104513);
  script_xref(name:"CISCO-BUG-ID", value:"CSCvd69951");
  script_xref(name:"CISCO-BUG-ID", value:"CSCve02459");
  script_xref(name:"CISCO-BUG-ID", value:"CSCve02461");
  script_xref(name:"CISCO-BUG-ID", value:"CSCve02463");
  script_xref(name:"CISCO-BUG-ID", value:"CSCve02474");
  script_xref(name:"CISCO-SA", value:"cisco-sa-20180620-fxnxos-ace");

  script_name(english:"Cisco NX-OS Software Cisco Fabric Services Arbitrary Code Execution (cisco-sa-20180620-fxnxos-ace)");

  script_set_attribute(attribute:"synopsis", value:
"The remote device is missing a vendor-supplied security patch");
  script_set_attribute(attribute:"description", value:
"A arbitrary code execution vulnerability exists in Cisco Fabric Services NXOS software 
due to insufficient validation of packet headers. An unauthenticated, remote attacker can
exploit this, via crafted packets, to execute arbitrary code. 

Please see the included Cisco BIDs and Cisco Security Advisory for more information.");
  script_set_attribute(attribute:"see_also", value:"http://tools.cisco.com/security/center/viewErp.x?alertId=ERP-67770");
  # https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20180620-fxnxos-ace
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?267dc032");
  script_set_attribute(attribute:"see_also", value:"https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvd69951");
  script_set_attribute(attribute:"see_also", value:"https://bst.cloudapps.cisco.com/bugsearch/bug/CSCve02459");
  script_set_attribute(attribute:"see_also", value:"https://bst.cloudapps.cisco.com/bugsearch/bug/CSCve02461");
  script_set_attribute(attribute:"see_also", value:"https://bst.cloudapps.cisco.com/bugsearch/bug/CSCve02463");
  script_set_attribute(attribute:"see_also", value:"https://bst.cloudapps.cisco.com/bugsearch/bug/CSCve02474");
  script_set_attribute(attribute:"solution", value:
"Upgrade to the relevant fixed version referenced in Cisco bug IDs CSCvd69951, CSCve02459, CSCve02461, CSCve02463,
CSCve02474, CSCve04859");
  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:U/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:U/RL:O/RC:C");
  script_set_attribute(attribute:"cvss_score_source", value:"CVE-2018-0304");

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

  script_set_attribute(attribute:"vuln_publication_date", value:"2018/06/20");
  script_set_attribute(attribute:"patch_publication_date", value:"2018/06/20");
  script_set_attribute(attribute:"plugin_publication_date", value:"2020/07/14");

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

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

  script_copyright(english:"This script is Copyright (C) 2020 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/Model", "Host/Cisco/NX-OS/Device");

  exit(0);
}

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

product_info = cisco::get_product_info(name:"Cisco NX-OS Software");

cbi = '';
version_list=make_list('');

if ('MDS' >< product_info.device && product_info.model =~ "^90[0-9][0-9]")
{
  cbi = 'CSCvd69951';
  version_list = [
  {'min_ver' : '5.2', 'fix_ver' : '6.2(21)'},
  {'min_ver' : '7.3', 'fix_ver' : '8.1(1a)'}
  ];
}
else if ('UCS' >< product_info.device && product_info.model =~ "^6[123][0-9][0-9]")
{
  cbi = 'CSCve02461';
  version_list = [
  {'min_ver' : '0.0', 'fix_ver' : '3.2(2b)'}
  ];
}
else if ('Nexus' >< product_info.device) 
{
  if (product_info.model =~ "^(20|55|56|60)[0-9][0-9]")
  {
    cbi = 'CSCve02463';
    version_list = [
      {'min_ver' : '0.0', 'fix_ver' :'7.3(3)N1(1)'}
    ];
  }
  else if (product_info.model =~ "^90[0-9][0-9]")
  {
    cbi = 'CSCve02459';
    version_list = [
      {'min_ver' : '0.0', 'fix_ver' : '7.0(3)I4(7)'},
      {'min_ver' : '7.0(3)I5', 'fix_ver' : '7.0(3)I7(1)'}
    ];
  }
  else if (product_info.model =~ "^35[0-9][0-9]")
  {
    cbi = 'CSCve02459';
    version_list = [
      {'min_ver' : '6.0', 'fix_ver' : '7.0(3)I7(2)'}
    ];
  }
  else if (product_info.model =~ "^7[70][0-9][0-9]")
  {
    cbi = 'CSCvd69951';
    version_list = [
      {'min_ver' : '0.0', 'fix_ver' : '6.2(20)'},
      {'min_ver' : '7.2', 'fix_ver' : '7.3(2)D1(1)'},
      {'min_ver' : '8.0', 'fix_ver' : '8.1(2)'}
    ];
  }
  else if (product_info.model =~ "^95[0-9][0-9]")
  {
    cbi = 'CSCve02474';
    version_list = [
      {'min_ver' : '7.0', 'fix_ver' : '7.0(3)F3(1)'}
    ];
  }
  else if (product_info.model =~ "^30[0-9][0-9]")
  {
    cbi = 'CSCve02459';
    version_list = [
      {'min_ver' : '0.0', 'fix_ver' : '7.0(3)I4(7)'},
      {'min_ver' : '7.0(3)I5', 'fix_ver' : '7.0(3)I7(1)'}
    ];
  }
}

if (cbi == '')
  audit(AUDIT_HOST_NOT, 'affected');

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

cisco::check_and_report(
  product_info:product_info,
  reporting:reporting,
  vuln_ranges:version_list
);