Vulnerabilities > CVE-2013-4729 - Permissions, Privileges, and Access Controls vulnerability in PHPmyadmin

047910
CVSS 5.5 - MEDIUM
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
SINGLE
Confidentiality impact
NONE
Integrity impact
PARTIAL
Availability impact
PARTIAL
network
low complexity
phpmyadmin
CWE-264
nessus

Summary

import.php in phpMyAdmin 4.x before 4.0.4.1 does not properly restrict the ability of input data to specify a file format, which allows remote authenticated users to modify the GLOBALS superglobal array, and consequently change the configuration, via a crafted request.

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Accessing, Modifying or Executing Executable Files
    An attack of this type exploits a system's configuration that allows an attacker to either directly access an executable file, for example through shell access; or in a possible worst case allows an attacker to upload a file and then execute it. Web servers, ftp servers, and message oriented middleware systems which have many integration points are particularly vulnerable, because both the programmers and the administrators must be in synch regarding the interfaces and the correct privileges for each interface.
  • 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.
  • Blue Boxing
    This type of attack against older telephone switches and trunks has been around for decades. A tone is sent by an adversary to impersonate a supervisor signal which has the effect of rerouting or usurping command of the line. While the US infrastructure proper may not contain widespread vulnerabilities to this type of attack, many companies are connected globally through call centers and business process outsourcing. These international systems may be operated in countries which have not upgraded Telco infrastructure and so are vulnerable to Blue boxing. Blue boxing is a result of failure on the part of the system to enforce strong authorization for administrative functions. While the infrastructure is different than standard current applications like web applications, there are historical lessons to be learned to upgrade the access control for administrative functions.
  • Restful Privilege Elevation
    Rest uses standard HTTP (Get, Put, Delete) style permissions methods, but these are not necessarily correlated generally with back end programs. Strict interpretation of HTTP get methods means that these HTTP Get services should not be used to delete information on the server, but there is no access control mechanism to back up this logic. This means that unless the services are properly ACL'd and the application's service implementation are following these guidelines then an HTTP request can easily execute a delete or update on the server side. The attacker identifies a HTTP Get URL such as http://victimsite/updateOrder, which calls out to a program to update orders on a database or other resource. The URL is not idempotent so the request can be submitted multiple times by the attacker, additionally, the attacker may be able to exploit the URL published as a Get method that actually performs updates (instead of merely retrieving data). This may result in malicious or inadvertent altering of data on the server.
  • Target Programs with Elevated Privileges
    This attack targets programs running with elevated privileges. The attacker would try to leverage a bug in the running program and get arbitrary code to execute with elevated privileges. For instance an attacker would look for programs that write to the system directories or registry keys (such as HKLM, which stores a number of critical Windows environment variables). These programs are typically running with elevated privileges and have usually not been designed with security in mind. Such programs are excellent exploit targets because they yield lots of power when they break. The malicious user try to execute its code at the same level as a privileged system call.

Nessus

  • NASL familyCGI abuses
    NASL idPHPMYADMIN_PMASA_2013_7.NASL
    descriptionAccording to its self-identified version number, the phpMyAdmin 4.x install hosted on the remote web server is earlier than 4.0.4.1 and, therefore, contains a flaw where the
    last seen2020-06-01
    modified2020-06-02
    plugin id67228
    published2013-07-10
    reporterThis script is Copyright (C) 2013-2018 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/67228
    titlephpMyAdmin 4.x < 4.0.4.1 import.php GLOBALS Variable Injection Configuration Parameter Manipulation (PMASA-2013-7)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(67228);
      script_version("1.3");
      script_cvs_date("Date: 2018/07/24 18:56:11");
    
      script_cve_id("CVE-2013-4729");
      script_bugtraq_id(60940);
    
      script_name(english:"phpMyAdmin 4.x < 4.0.4.1 import.php GLOBALS Variable Injection Configuration Parameter Manipulation (PMASA-2013-7)");
      script_summary(english:"Checks version of phpMyAdmin");
    
      script_set_attribute(attribute:"synopsis", value:
    "The remote web server hosts a PHP application that is affected by a
    security vulnerability.");
      script_set_attribute(attribute:"description", value:
    "According to its self-identified version number, the phpMyAdmin 4.x
    install hosted on the remote web server is earlier than 4.0.4.1 and,
    therefore, contains a flaw where the 'import.php' script does not
    properly sanitize input.  This could allow attackers to inject arbitrary
    GLOBALS variables and thereby manipulate any configuration parameter.");
      script_set_attribute(attribute:"see_also", value:"http://www.phpmyadmin.net/home_page/security/PMASA-2013-7.php");
      script_set_attribute(attribute:"solution", value:
    "Either upgrade to phpMyAdmin 4.0.4.1 or later, or apply the patches
    from the referenced link.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:S/C:N/I:P/A:P");
      script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"No exploit is required");
      script_set_attribute(attribute:"exploit_available", value:"false");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2013/06/30");
      script_set_attribute(attribute:"patch_publication_date", value:"2013/06/30");
      script_set_attribute(attribute:"plugin_publication_date", value:"2013/07/10");
    
      script_set_attribute(attribute:"potential_vulnerability", value:"true");
      script_set_attribute(attribute:"plugin_type", value:"remote");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:phpmyadmin:phpmyadmin");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_family(english:"CGI abuses");
    
      script_copyright(english:"This script is Copyright (C) 2013-2018 Tenable Network Security, Inc.");
    
      script_dependencies("phpMyAdmin_detect.nasl");
      script_require_ports("Services/www", 80);
      script_require_keys("www/PHP", "www/phpMyAdmin", "Settings/ParanoidReport");
    
      exit(0);
    }
    
    include("audit.inc");
    include("global_settings.inc");
    include("misc_func.inc");
    include("http.inc");
    include("webapp_func.inc");
    
    port = get_http_port(default:80, php:TRUE);
    
    install = get_install_from_kb(appname:"phpMyAdmin", port:port, exit_on_fail:TRUE);
    dir = install['dir'];
    location = build_url(qs:dir, port:port);
    
    version = install['ver'];
    if (version == UNKNOWN_VER) audit(AUDIT_UNKNOWN_WEB_APP_VER, "phpMyAdmin", location);
    
    if (report_paranoia < 2) audit(AUDIT_PARANOID);
    
    if (version =~ "^4(\.0)?$") exit(1, "The version of phpMyAdmin located at "+ location +" ("+ version +") is not granular enough.");
    
    # 4.0.0 < 4.0.4.1
    if (version =~ "^4\.0\.([0-3]|4($|-rc\d)|4.0)([^0-9]|$)")
    {
      if (report_verbosity > 0)
      {
        report =
          '\n  URL               : ' + location +
          '\n  Installed version : ' + version +
          '\n  Fixed version     : 4.0.4.1' +
          '\n';
        security_warning(port:port, extra:report);
      }
      else security_warning(port);
      exit(0);
    }
    else audit(AUDIT_WEB_APP_NOT_AFFECTED, "phpMyAdmin", location, version);
    
  • NASL familyFreeBSD Local Security Checks
    NASL idFREEBSD_PKG_1B93F6FEE1C111E2948D6805CA0B3D42.NASL
    descriptionThe phpMyAdmin development team reports : The import.php script was vulnerable to GLOBALS variable injection. Therefore, an attacker could manipulate any configuration parameter. This vulnerability can be triggered only by someone who logged in to phpMyAdmin, as the usual token protection prevents non-logged-in users from accessing the required form.
    last seen2020-06-01
    modified2020-06-02
    plugin id67117
    published2013-07-01
    reporterThis script is Copyright (C) 2013-2018 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/67117
    titleFreeBSD : phpMyAdmin -- Global variable scope injection (1b93f6fe-e1c1-11e2-948d-6805ca0b3d42)

Seebug

bulletinFamilyexploit
descriptionCVE(CAN) ID: CVE-2013-4729 phpmyadmin是MySQL数据库的在线管理工具,主要功能包括在线创建数据表、运行SQL语句、搜索查询数据以及导入导出数据等。 phpMyAdmin 4.0.4.1之前版本内的import.php没有正确限制文件格式定义数据输入权限,可使经过身份验证的远程用户修改GLOBALS超级全局数组,然后通过特制的请求更改配置。 0 phpMyAdmin &lt;= 4.0.4.1 厂商补丁: phpMyAdmin ---------- phpMyAdmin已经为此发布了一个安全公告(PMASA-2013-7)以及相应补丁: PMASA-2013-7:PMASA-2013-7 链接:http://www.phpmyadmin.net/home_page/security/PMASA-2013-7.php 补丁下载:https://github.com/phpmyadmin/phpmyadmin/commit/012464268420e53a9cd81cbb4a43988d70393c36
idSSV:60872
last seen2017-11-19
modified2013-07-10
published2013-07-10
reporterRoot
titlephpMyAdmin &lt;= 4.0.4.1 import.php GLOBALS变量注入漏洞