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 2017-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 4db7ef07fd0afdb00b80634f2005dd360f2c159a950ea21ea9a66930d168946f8fc9c8645b9535d8298e9ee98c22dfb55a03cfc6432ba479bb7cbf1297febe92303decdbc56d4836ba50a2e71c495b749ff570b2901c76622a4d2cac3a3ca7a9e11b6838106404a910975bc3bffeefff597e96f0db1b990c1b90677ddd91142e4fb55b24b6147dcdd59d548d7666228bb2b144b3d2e1eb4955efe178f0b525180aca4c9211c7cf403e0ce8ca54d206b0a704a34173c45d672b00ac3350c77ed8900c7c5d46fbdfec5d7b09c3780e553ab5e3fa868ad042f898d0f8bb368e52ba9cb6ed52a29d2a94f263a1ba14ddce78735d590f0741b5a41aa3e5a77fee8c4d4f423a86580d2cf9afc85c3dcfda7986c803ff9bfbb82ea552d1fded971c32d8e1fef98fafebe53b65cba8f43d6d7cef9733e0132b260673df7cb78d92e048f773fc50bdec5f4ddc3fe734706ea1ad2aebaedf4003aefb5197100c9d0b9d4a0b19e335d14b0ba8a677d7ad214e773dac75030b6110754f61c594d588666eb4f653457ca7875af7076df569e1a7dff49aa11f955482bb147d4a19b63cbc7af0732ed782e76f0b87a1981e5754a001e5448909a058bf227fe5f271757e2462e0c2c0e753e4d1d4de5a3590ca4bb53089b7f93fb654b1d8dd8bb416ff23de19c9fab7499299ee40bcc20c0967582a561485ee1a1067b1182f93e8dc47d419bb1a51
#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

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

  script_cve_id("CVE-2014-2119");
  script_bugtraq_id(66309);
  script_osvdb_id(104660);
  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:ND/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-2017 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);