Vulnerabilities > CVE-2016-0909 - Improper Input Validation vulnerability in EMC Avamar Data Store and Avamar Server Virtual Edition

047910
CVSS 8.4 - HIGH
Attack vector
LOCAL
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
HIGH
Integrity impact
HIGH
Availability impact
HIGH
local
low complexity
emc
CWE-20
nessus

Summary

EMC Avamar Data Store (ADS) and Avamar Virtual Edition (AVE) versions 7.3 and older contain a vulnerability that may expose the Avamar servers to potentially be compromised by malicious users.

Vulnerable Configurations

Part Description Count
Application
Emc
2

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 familyMisc.
NASL idEMC_AVAMAR_ESA-2016-111.NASL
descriptionAccording to its self-reported version number, the EMC Avamar Data Store (ADS) or Avamar Virtual Edition (AVE) software running on the remote host is a version prior to 7.3.0 Hotfix 263301 (7.3.0.233), or the configuration is not patched. It is, therefore, affected by a local privilege escalation vulnerability that allows a local attacker to execute arbitrary PostgreSQL commands and thereby gain elevated privileged.
last seen2020-06-01
modified2020-06-02
plugin id95921
published2016-12-16
reporterThis script is Copyright (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
sourcehttps://www.tenable.com/plugins/nessus/95921
titleEMC Avamar ADS / AVE < 7.3.0 Hotfix 263301 PostgreSQL Command Local Privilege Escalation (ESA-2016-111)
code
#TRUSTED 3856cea177d8403dc016eefba0a6af1f8aba389079b9962e74e7a68170dbaed5c58adf582984376fe43d32dadda4664c2cf228105db5193a2be6034c0563851ec0f66d4f0643eefec247d54d0d1f198eee73619d4a208e242e82e4a6530ff7e5fca855bd1799343b1b601eb27d0b733c2c6c1fb18662ae83fe74ba25ce0ae469063468135e74db89f1098773ef9cade8351781f783fd171c7d41f945e25090b5e4ae6465e387568337619e38c31c7d91e8a6104c39a65fd1690d0d1d6f51992a91bd1d1ebb0dd55ef44677f9469388efa67c6298f6daaebb34414430e26fde323a8f199bb4dbcfe4ce7c6ae32217d61c667c727c5d6081fd83ec4f9a80a4a336ad064b871d688f2c37af455dc925d3ea7d34073878628a7e6216bd4eb4059d059f79d2d04d3a7baaf87df075f64384ab3a2259d90c01bef1e143d0173a5a87de116dc5e210bbffba0bd79389bb9d64a092c4b8dd95916dddb3e44ddfae0dd4130c6f99862679a494f729a4f59150006b9d83fc2c113d2a6cf879dedb63aca7eb4f7f22a471b67249b3598266a2d6d4ae5477471d6795dce0bb200f5c1bbd06e17f4e02df794db48bdfb55ba4f63c9f8dabe2bb4fcdedc84ee93ccb85447706cef74531f8512af7d47a920c3171a30a1462e3758097da41583e44c26f6a309db9d6cec13375c16656983a7c72697b03bbf978683a3b544b3e5de857b2414cd59f
#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

if (description)
{
  script_id(95921);
  script_version("1.16");
  script_cvs_date("Date: 2019/11/13");

  script_cve_id("CVE-2016-0909");
  script_bugtraq_id(93788);

  script_name(english:"EMC Avamar ADS / AVE < 7.3.0 Hotfix 263301 PostgreSQL Command Local Privilege Escalation (ESA-2016-111)");
  script_summary(english:"Checks the version and configuration of EMC Avamar.");

  script_set_attribute(attribute:"synopsis", value:
"A backup solution running on the remote host is affected by a local
privilege escalation vulnerability.");
  script_set_attribute(attribute:"description", value:
"According to its self-reported version number, the EMC Avamar Data
Store (ADS) or Avamar Virtual Edition (AVE) software running on the
remote host is a version prior to 7.3.0 Hotfix 263301 (7.3.0.233),
or the configuration is not patched. It is, therefore, affected by a
local privilege escalation vulnerability that allows a local attacker
to execute arbitrary PostgreSQL commands and thereby gain elevated
privileged.");
  script_set_attribute(attribute:"see_also", value:"https://seclists.org/bugtraq/2016/Oct/att-45/ESA-2016-111.txt");
  script_set_attribute(attribute:"see_also", value:"https://support.emc.com/kb/486276");
  script_set_attribute(attribute:"solution", value:
"Upgrade to EMC Avamar ADS / AVE version 7.3.0 Hotfix 263301
(7.3.0.233) and apply the configuration changes documented in
KB486276.");
  script_set_cvss_base_vector("CVSS2#AV:L/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:L/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-2016-0909");

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

  script_set_attribute(attribute:"vuln_publication_date", value:"2016/10/20");
  script_set_attribute(attribute:"patch_publication_date", value:"2016/10/20");
  script_set_attribute(attribute:"plugin_publication_date", value:"2016/12/16");

  script_set_attribute(attribute:"plugin_type", value:"combined");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:emc:avamar");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:emc:avamar_data_store");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:emc:avamar_server_virtual_edition");
  script_end_attributes();

  script_category(ACT_GATHER_INFO);
  script_family(english:"Misc.");

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

  script_dependencies("emc_avamar_server_detect.nbin", "emc_avamar_server_installed_nix.nbin");
  script_require_keys("installed_sw/EMC Avamar");

  exit(0);
}

include("audit.inc");
include("global_settings.inc");
include("install_func.inc");
include("ssh_func.inc");
include("hostlevel_funcs.inc");
include("telnet_func.inc");
include("http.inc");
include("misc_func.inc");


if(sshlib::get_support_level() >= sshlib::SSH_LIB_SUPPORTS_COMMANDS)
  enable_ssh_wrappers();
else disable_ssh_wrappers();

app = "EMC Avamar";
get_install_count(app_name:app, exit_if_zero:TRUE);

install = make_array();
port = 0;

if (get_kb_item("installed_sw/EMC Avamar/local"))
{
  install = get_single_install(app_name:app, exit_if_unknown_ver:TRUE);
}
else
{
  port = get_http_port(default:443);
  install = get_single_install(app_name:app, port:port, exit_if_unknown_ver:TRUE);
}

version    = install['version'];
version_ui = install['display_version'];
hotfixes   = install['Hotfixes'];

fix_ver = '7.3.0.233';
fix_hf  = '263301';

vuln         = FALSE; 
config_check = FALSE;

report_fix    = NULL;
insecure_file = NULL;

if (ver_compare(ver:version, fix:fix_ver, strict:FALSE) < 0)
  vuln = TRUE;

# Remote checks cannot check the configuration or hotfix reliably
if (!vuln && port != 0)
  exit(0, "The "+app+" "+version_ui+" install listening on port "+port+" may be affected but Nessus was unable to test for the issue. Please provide valid credentials to test for the issue.");

# Check for hotfixes
if (ver_compare(ver:version, fix:fix_ver, strict:FALSE) == 0)
{
  if (empty_or_null(hotfixes))
    vuln = TRUE;
  else
  {
    hotfixes = split(hotfixes, sep:";", keep:FALSE);
    foreach hotfix (hotfixes)
    {
      if (fix_hf == hotfix)
      {
        config_check = TRUE;
        version_ui += " HF" + fix_hf;
      }
    }
    if (!config_check) vuln = TRUE;
  } 
}
# For versions later than 7.3.0.233 HF263301 we still need to check the configs
else if (ver_compare(ver:version, fix:fix_ver, strict:FALSE) > 0)
  config_check = TRUE;

# Only check configuration if 7.3.0.233 HF263301 or higher is detected
# Look for configurations from KB486276 (https://support.emc.com/kb/486276)
if (config_check)
{
  if (!get_kb_item("Host/local_checks_enabled") ) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);

  # Select transport
  if (islocalhost())
  {
    if (!defined_func("pread"))
      exit(1, "'pread()' is not defined.");
    info_t = INFO_LOCAL;
  }
  else
  {
    sock_g = ssh_open_connection();
    if (!sock_g)
      audit(AUDIT_FN_FAIL, 'ssh_open_connection');
    info_t = INFO_SSH;
  }

  config_check = TRUE;
  path = "/usr/local/avamar/var/mc/server_data/";

  configs = make_array(
    "postgres/data/pg_hba.conf",
      [make_list("local all all peer map=mcdb",
                "hostssl all all samehost cert clientcert=1",
                "host mcdb viewuser 0.0.0.0/0 md5",
                "host mcdb viewuser ::0/0 md5"), "# PostgreSQL"],
    "postgres/data/pg_ident.conf",
      [make_list("mcdb admin admin",
                "mcdb admin viewuser",
                "mcdb root admin",
                "mcdb root viewuser"), "# PostgreSQL"],
    "postgres/data/postgresql.conf",
      [make_list("ssl = on"), "# PostgreSQL"],
    "prefs/mcserver.xml",
      [make_list('<entry key="database_sslmode" value="true" />'), "com.avamar.asn"]
  );

  foreach subpath (keys(configs))
  {
    content = info_send_cmd(cmd:"cat " + path + subpath);
    foreach config (configs[subpath][0])
    {
      conf_pattern = configs[subpath][1];

      pattern = str_replace(string:config, find:" ", replace:'\\s+');
      pattern = '^\\s*' + pattern + '\\s*';
      if (conf_pattern >< content && !preg(string:content, pattern:pattern, icase:TRUE, multiline:TRUE))
      {
        insecure_file = path + subpath;
        report_fix = "Apply the configurations as documented in KB486276." +
          '\n  Insecure file     : ' + insecure_file ;         
        vuln = TRUE;
        break;
      }
    }
    if (vuln) break;
  }
  if (info_t == INFO_SSH) ssh_close_connection();
}
else
{
  report_fix =
    fix_ver + " HF" + fix_hf + " and apply the configurations as documented in KB486276.";
}

if (!vuln)
  audit(AUDIT_INST_VER_NOT_VULN, app, version_ui);

report =
  '\n  Installed version : ' + version_ui +
  '\n  Fixed version     : ' + report_fix +
  '\n';

security_report_v4(
  extra    : report,
  port     : port,
  severity : SECURITY_HOLE
);