Cisco NX-OS Software Python Parser Escape Vulnerability

2017-10-24T00:00:00
ID CISCO-SA-20171018-PPE-NX-OS.NASL
Type nessus
Reporter Tenable
Modified 2018-07-06T00:00:00

Description

According to its self-reported version, the Cisco NX-OS Software is affected by one or more vulnerabilities. Please see the included Cisco BIDs and the Cisco Security Advisory for more information.

                                        
                                            #
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

if (description)
{
  script_id(104127);
  script_version("1.3");
  script_cvs_date("Date: 2018/07/06 11:26:06");

  script_cve_id("CVE-2017-12301");
  script_xref(name:"CISCO-BUG-ID", value:"CSCvb86832");
  script_xref(name:"CISCO-BUG-ID", value:"CSCvd86474");
  script_xref(name:"CISCO-BUG-ID", value:"CSCvd86479");
  script_xref(name:"CISCO-BUG-ID", value:"CSCvd86484");
  script_xref(name:"CISCO-BUG-ID", value:"CSCvd86490");
  script_xref(name:"CISCO-BUG-ID", value:"CSCve97102");
  script_xref(name:"CISCO-BUG-ID", value:"CSCvf12757");
  script_xref(name:"CISCO-BUG-ID", value:"CSCvf12804");
  script_xref(name:"CISCO-BUG-ID", value:"CSCvf12815");
  script_xref(name:"CISCO-BUG-ID", value:"CSCvf15198");

  script_xref(name:"CISCO-SA", value:"cisco-sa-20171018-ppe");

  script_name(english:"Cisco NX-OS Software Python Parser Escape Vulnerability");
  script_summary(english:"Checks the Cisco NX-OS Software version.");

  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, the Cisco NX-OS Software is
affected by one or more vulnerabilities. Please see the included Cisco
BIDs and the Cisco Security Advisory for more information.");
  # https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20171018-ppe
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?f51931d1");
  script_set_attribute(attribute:"see_also", value:"https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvb86832");
  script_set_attribute(attribute:"see_also", value:"https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvd86474");
  script_set_attribute(attribute:"see_also", value:"https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvd86479");
  script_set_attribute(attribute:"see_also", value:"https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvd86484");
  script_set_attribute(attribute:"see_also", value:"https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvd86490");
  script_set_attribute(attribute:"see_also", value:"https://bst.cloudapps.cisco.com/bugsearch/bug/CSCve97102");
  script_set_attribute(attribute:"see_also", value:"https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvf12757");
  script_set_attribute(attribute:"see_also", value:"https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvf12804");
  script_set_attribute(attribute:"see_also", value:"https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvf12815");
  script_set_attribute(attribute:"see_also", value:"https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvf15198");

  script_set_attribute(attribute:"solution", value:
"Upgrade to the relevant fixed version referenced in Cisco Security
Advisory cisco-sa-20171018-ppe.");
  script_set_cvss_base_vector("CVSS2#AV:L/AC:L/Au:N/C:P/I:P/A:P");
  script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C");
  script_set_cvss3_base_vector("CVSS:3.0/AV:L/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:L");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:U/RL:O/RC:C");
  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:"2017/10/18");
  script_set_attribute(attribute:"patch_publication_date", value:"2017/10/18");
  script_set_attribute(attribute:"plugin_publication_date", value:"2017/10/24");

  script_set_attribute(attribute:"plugin_type", value:"local");
  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) 2017-2018 Tenable Network Security, Inc.");

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

  exit(0);
}

include("audit.inc");
include("cisco_workarounds.inc");
include("ccf.inc");

device = get_kb_item_or_exit("Host/Cisco/NX-OS/Device");
model = get_kb_item_or_exit("Host/Cisco/NX-OS/Model");

# not affected if not MDS or Nexus
if ('MDS' >!< device && 'Nexus' >!< device)
  audit(AUDIT_HOST_NOT, "an affected device and/or model");

# Only models 2000, 3000, 5000, 6000, 7000, 9000 (handled below)
# and 3500, 5500, 5600, 7700, 9500 are affected

# Affected:        Nexus 9000 Series Switches - Standalone, NX-OS mode
# Not Affected:    Nexus 9000 Series Fabric Switches - ACI mode

# We do not have a 9000 series (fabric and non-fabric), nor do we
# know the banner. For now we are only checking the 9000 series if
# we are in paranoid mode.

# the paranoid series checks are 2000, 2000, 5000, 6000, 7000, 9000
# non-paranoid series checks are 2000, 3000, 5000, 6000, 7000

if (report_paranoia >= 2)
{
  if ('Nexus' >< device &&
    model !~ "^[235679][0-9][0-9][0-9]([^0-9]|$)$" &&
    model !~ "^(35|55|77|95)[0-9][0-9]([^0-9]|$)$"
  )
    audit(AUDIT_HOST_NOT, "an affected device and/or model");
}
else
{
  if ('Nexus' >< device &&
    model !~ "^[23567][0-9][0-9][0-9]([^0-9]|$)$" &&
    model !~ "^(35|55|77|95)[0-9][0-9]([^0-9]|$)$"
  )
    audit(AUDIT_HOST_NOT, "an affected device and/or model");
}

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

version_list = make_list(
  "6.0(2)A8(3)",
  "6.0(2)A8(6.213)",
  "7.0(0)HSK(0.357)",
  "7.0(3)I4(6)",
  "7.0(7)N1(1)",
  "7.3(2)D1(0.21)",
  "8.0(0.74)",
  "8.0(1)",
  "8.1(0)BD(0.20)",
  "8.1(0.2)S0",
  "8.1(0.70)S0"
);

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

reporting = make_array(
  'port'     , 0,
  'severity' , SECURITY_WARNING,
  'version'  , product_info['version'],
  'bug_id'   , "CSCvb86832, CSCvd86474, CSCvd86479, CSCvd86484, CSCvd86490, CSCve97102, CSCvf12757, CSCvf12804, CSCvf12815, CSCvf15198"
);

cisco::check_and_report(product_info:product_info, workarounds:workarounds, workaround_params:workaround_params, reporting:reporting, vuln_versions:version_list);