Cisco AsyncOS for Email Security Appliances Software Remote Code Execution (CSCug79377)

2014-03-26T00:00:00
ID CISCO-SA-20140319-ESA.NASL
Type nessus
Reporter Tenable
Modified 2018-07-06T00:00:00

Description

According to its self-reported version and configuration, the Cisco AsyncOS running on the remote Cisco Email Security (ESA) appliance is affected by a remote code execution vulnerability in the Safelist/Blocklist (SLBL) function due to improper handling of SLBL database files. An authenticated, remote attacker can exploit this vulnerability to execute arbitrary code with the privileges of the 'root' user.

                                        
                                            #TRUSTED 3208a6e62841e5a4ef054a7f8ca7c800bb06af824ec47380a3daaf540328b7e24a10c5c94ff22be6ca009adde6fa923a6b46bb6f0d297b7af0a81f4cf1fa818c08862d57b4872e00d3e8c6bf134abd7e6c2a75b1ea492e390dfde92333c95675e8f4043ea24e9fe75032c20f7ea1ff34dd462df729b550a17a1c45b8161fb38574d035ff44607e484fb9f57ed470f4398f6258478be9aef16be4e0c0846b8613c9b2b652407cc1a0edc0ca06ba4891845bae0cead6083cf2a42532fcc740e4e415a61867a0ad60ec9460b4a3195c6867bd4d00ee09e7f74ac82b9f31251f86c4f357cf5e73dbdac33a294ecd88b0a6bfb8951f4da832395a67e61e4e775068e6554d504f37ffefdf6d7eab21b5fc9d164d924e22da25f19dcb74c2922621982d145b592b092d3953d5d1279920edcd68adc57bdc5757aa019cbdca7ce5f6b1403f76a689d6bd91a2dccc78f55dd130e0b3f877b2419d0263cfa1388d864297f559b03dc45258f83ecc5e7a1c172bdfc8e9381cf3b13bb98376840d89b4400656630f8c6ea7e62eafbf3f4600071aeabb116101a0e8073cc775cd624221871cb8da7dd9effeda39890d71bc65432cbf0befab069de61966747196ab7a902ea9a895a376cecadebe5a41dfc3d4d8a2319ac4771227ab369316588deebdd74b1813240eac0e53d0ddb2b97f051dffde21f1976728f67be9964572606aa36632a06c
#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

if (description)
{
  script_id(73210);
  script_version("1.9");
  script_set_attribute(attribute:"plugin_modification_date", value:"2018/07/06");

  script_cve_id("CVE-2014-2119");
  script_bugtraq_id(66309);
  script_xref(name:"CISCO-BUG-ID", value:"CSCug79377");
  script_xref(name:"CISCO-SA", value:"cisco-sa-20140319-asyncos");

  script_name(english:"Cisco AsyncOS for Email Security Appliances Software Remote Code Execution (CSCug79377)");
  script_summary(english:"Checks ESA version");

  script_set_attribute(attribute:"synopsis", value:
"The remote security appliance is missing a vendor-supplied security
patch.");
  script_set_attribute(attribute:"description", value:
"According to its self-reported version and configuration, the Cisco
AsyncOS running on the remote Cisco Email Security (ESA) appliance is
affected by a remote code execution vulnerability in the
Safelist/Blocklist (SLBL) function due to improper handling of SLBL
database files. An authenticated, remote attacker can exploit this
vulnerability to execute arbitrary code with the privileges of the
'root' user.");
  # http://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20140319-asyncos
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?b22bd304");
  script_set_attribute(attribute:"solution", value:
"Apply the relevant update referenced in Cisco Security Advisory
cisco-sa-20140319-asyncos.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:S/C:C/I:C/A:C");
  script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H");
  script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/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:"2014/03/19");
  script_set_attribute(attribute:"patch_publication_date", value:"2013/11/06");
  script_set_attribute(attribute:"plugin_publication_date", value:"2014/03/26");

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

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

  script_copyright(english:"This script is Copyright (C) 2014-2018 Tenable Network Security, Inc.");

  script_dependencies("cisco_esa_version.nasl");
  script_require_keys("Host/AsyncOS/Cisco Email Security Appliance/DisplayVersion", "Host/AsyncOS/Cisco Email Security Appliance/Version");
  script_require_ports("Services/ftp", "Settings/ParanoidReport");

  exit(0);
}

include("audit.inc");
include("cisco_func.inc");
include("cisco_kb_cmd_func.inc");

display_ver = get_kb_item_or_exit('Host/AsyncOS/Cisco Email Security Appliance/DisplayVersion');
ver = get_kb_item_or_exit('Host/AsyncOS/Cisco Email Security Appliance/Version');

vuln = FALSE;

if (get_kb_item("Host/local_checks_enabled")) local_checks = TRUE;
else local_checks = FALSE;

if (ver =~ "^[0-6]\." || ver =~ "^7\.[01]\.") # 7.1 and prior
  display_fix = '7.6.3-023';
else if (ver =~ "^7\.3\.")
  display_fix = '8.0.1-023';
else if (ver =~ "^7\.5\.")
  display_fix = '7.6.3-023';
else if (ver =~ "^7\.6\.")
  display_fix = '7.6.3-023';
else if (ver =~ "^7\.8\.")
  display_fix = '8.0.1-023';
else if (ver =~ "^8\.0\.")
  display_fix = '8.0.1-023';
else
  audit(AUDIT_INST_VER_NOT_VULN, 'Cisco ESA', display_ver);

fix = str_replace(string:display_fix, find:'-', replace:'.');

# Compare version to determine if affected. FTP must also be enabled
# or paranoia setting must be above 1.
if (
  ver_compare(ver:ver, fix:fix, strict:FALSE) == -1 &&
  (get_kb_list("Services/ftp") || report_paranoia > 1)
) vuln = TRUE;

# If local checks are enabled, confirm whether SLBL service is
# enabled. If they are not, only report if running a paranoid scan.
if (local_checks && vuln)
{
  vuln = FALSE;

  buf = cisco_command_kb_item("Host/Cisco/Config/slblconfig", "slblconfig");
  if (check_cisco_result(buf) && preg(multiline:TRUE, pattern:"Blocklist: Enabled", string:buf))
    vuln = TRUE;
}
else if (!local_checks && report_paranoia < 2) vuln = FALSE;

if (vuln)
{
  if (report_verbosity > 0)
  {
    report =
      '\n  Installed version : ' + display_ver +
      '\n  Fixed version     : ' + display_fix +
      '\n';

    if (!local_checks) report +=
      '\n' + 'Nessus was unable to determine whether the End-User Safelist /' +
      '\n' + 'Blocklist service is running because local checks are not' +
      '\n' + 'enabled.' +
      '\n';
    security_hole(port:0, extra:report);
  }
  else security_hole(0);
  exit(0);
}
else audit(AUDIT_INST_VER_NOT_VULN, 'Cisco ESA', display_ver);