Vulnerabilities > CVE-2017-8080 - Unrestricted Upload of File with Dangerous Type vulnerability in Atlassian Hipchat Server

047910
CVSS 8.8 - HIGH
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
LOW
Confidentiality impact
HIGH
Integrity impact
HIGH
Availability impact
HIGH
network
low complexity
atlassian
CWE-434
nessus

Summary

Atlassian Hipchat Server before 2.2.4 allows remote authenticated users with user level privileges to execute arbitrary code via vectors involving image uploads.

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Accessing Functionality Not Properly Constrained by ACLs
    In applications, particularly web applications, access to functionality is mitigated by the authorization framework, whose job it is to map ACLs to elements of the application's functionality; particularly URL's for web apps. In the case that the administrator failed to specify an ACL for a particular element, an attacker may be able to access it with impunity. An attacker with the ability to access functionality not properly constrained by ACLs can obtain sensitive information and possibly compromise the entire application. Such an attacker can access resources that must be available only to users at a higher privilege level, can access management sections of the application or can run queries for data that he is otherwise not supposed to.
  • Privilege Abuse
    An adversary is able to exploit features of the target that should be reserved for privileged users or administrators but are exposed to use by lower or non-privileged accounts. Access to sensitive information and functionality must be controlled to ensure that only authorized users are able to access these resources. If access control mechanisms are absent or misconfigured, a user may be able to access resources that are intended only for higher level users. An adversary may be able to exploit this to utilize a less trusted account to gain information and perform activities reserved for more trusted accounts. This attack differs from privilege escalation and other privilege stealing attacks in that the adversary never actually escalates their privileges but instead is able to use a lesser degree of privilege to access resources that should be (but are not) reserved for higher privilege accounts. Likewise, the adversary does not exploit trust or subvert systems - all control functionality is working as configured but the configuration does not adequately protect sensitive resources at an appropriate level.

Nessus

NASL familyMisc.
NASL idATLASSIAN_HIPCHAT_SERVER_2_2_4.NASL
descriptionThe version of Atlassian HipChat Server installed on the remote host is 1.0 or later but prior to 2.2.4. It is, therefore, affected by a remote code execution vulnerability due to improper validation of uploaded images. An authenticated, remote attacker can exploit this, via a specially crafted image, to execute arbitrary code.
last seen2020-06-01
modified2020-06-02
plugin id100160
published2017-05-12
reporterThis script is Copyright (C) 2017-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
sourcehttps://www.tenable.com/plugins/nessus/100160
titleAtlassian HipChat Server 1.0 < 2.2.4 Image Upload RCE
code
#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

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

  script_cve_id("CVE-2017-8080");
  script_bugtraq_id(98262);
  script_xref(name:"IAVA", value:"2017-A-0139");

  script_name(english:"Atlassian HipChat Server 1.0 < 2.2.4 Image Upload RCE");
  script_summary(english:"Checks hipchat-release for version.");

  script_set_attribute(attribute:"synopsis", value:
"The remote chat server is affected by a remote code execution
vulnerability.");
  script_set_attribute(attribute:"description", value:
"The version of Atlassian HipChat Server installed on the remote host
is 1.0 or later but prior to 2.2.4. It is, therefore, affected by a
remote code execution vulnerability due to improper validation of
uploaded images. An authenticated, remote attacker can exploit this,
via a specially crafted image, to execute arbitrary code.");
  # https://confluence.atlassian.com/hc/hipchat-server-security-advisory-2017-04-24-894234898.html
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?6fd02a11");
  script_set_attribute(attribute:"see_also", value:"https://jira.atlassian.com/browse/HCPUB-2980");
  script_set_attribute(attribute:"solution", value:
"Update to Atlassian HipChat Server version 2.2.4 or later.
Alternatively, apply the patch specified in the vendor advisory.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:S/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:N/AC:L/PR:L/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-2017-8080");

  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/04/24");
  script_set_attribute(attribute:"patch_publication_date", value:"2017/04/24");
  script_set_attribute(attribute:"plugin_publication_date", value:"2017/05/12");

  script_set_attribute(attribute:"plugin_type", value:"local");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:atlassian:hipchat_server");
  script_set_attribute(attribute:"stig_severity", value:"I");
  script_end_attributes();

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

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

  script_dependencies("ssh_get_info.nasl");
  script_require_keys("Host/HipChat", "Host/HipChat/version");

  exit(0);
}

include("audit.inc");
include("global_settings.inc");
include("misc_func.inc");

app = "HipChat Server";
fix = '2.2.4';
flag = 0;

if ( ! get_kb_item("Host/local_checks_enabled") ) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
version = get_kb_item("Host/HipChat/version");
if ( isnull(version) ) audit(AUDIT_OS_NOT, app);

# Affected Versions:
# 1.0 <= x
# x < 2.2.4
if (ver_compare(ver:version, fix:'1.0', strict:FALSE) < 0) audit(AUDIT_INST_VER_NOT_VULN, app, version);

if (ver_compare(ver:version, fix:fix, strict:FALSE) < 0)
{
  flag = 1;
  # Patch states it applies only to 2.2.2 and 2.2.3
  if (version =~ "^2\.2\.[23]$")
  {
    flag = 0;

    pkg_list = get_kb_item("Host/Debian/dpkg-l");
    if ( ! pkg_list ) audit(AUDIT_PACKAGE_LIST_MISSING);

    if ("ghostscript" >< pkg_list) flag = 1;
  }
}

if (flag)
{
    report =
      '\n  Installed version : ' + version  +
      '\n  Fixed version     : ' + fix +
      '\n';

  security_report_v4(port: 0, severity: SECURITY_WARNING, extra: report);
  exit(0);
}
else audit(AUDIT_INST_VER_NOT_VULN, app, version);