Vulnerabilities > CVE-2013-3238 - Arbitrary PHP Code Execution vulnerability in phpMyAdmin

047910
CVSS 6.0 - MEDIUM
Attack vector
NETWORK
Attack complexity
MEDIUM
Privileges required
SINGLE
Confidentiality impact
PARTIAL
Integrity impact
PARTIAL
Availability impact
PARTIAL
network
phpmyadmin
nessus
exploit available
metasploit

Summary

phpMyAdmin 3.5.x before 3.5.8 and 4.x before 4.0.0-rc3 allows remote authenticated users to execute arbitrary code via a /e\x00 sequence, which is not properly handled before making a preg_replace function call within the "Replace table prefix" feature.

Exploit-Db

  • descriptionphpMyAdmin 3.5.8 and 4.0.0-RC2 - Multiple Vulnerabilities. CVE-2013-3238,CVE-2013-3239,CVE-2013-3240,CVE-2013-3241. Webapps exploit for php platform
    idEDB-ID:25003
    last seen2016-02-03
    modified2013-04-25
    published2013-04-25
    reporterwaraxe
    sourcehttps://www.exploit-db.com/download/25003/
    titlephpMyAdmin 3.5.8 and 4.0.0-RC2 - Multiple Vulnerabilities
  • descriptionphpMyAdmin Authenticated Remote Code Execution via preg_replace(). CVE-2013-3238. Remote exploit for php platform
    fileexploits/php/remote/25136.rb
    idEDB-ID:25136
    last seen2016-02-03
    modified2013-05-01
    platformphp
    port
    published2013-05-01
    reportermetasploit
    sourcehttps://www.exploit-db.com/download/25136/
    titlephpMyAdmin Authenticated Remote Code Execution via preg_replace
    typeremote

Metasploit

descriptionThis module exploits a PREG_REPLACE_EVAL vulnerability in phpMyAdmin's replace_prefix_tbl within libraries/mult_submits.inc.php via db_settings.php This affects versions 3.5.x < 3.5.8.1 and 4.0.0 < 4.0.0-rc3. PHP versions > 5.4.6 are not vulnerable.
idMSF:EXPLOIT/MULTI/HTTP/PHPMYADMIN_PREG_REPLACE
last seen2020-06-04
modified2017-07-24
published2013-04-26
references
reporterRapid7
sourcehttps://github.com/rapid7/metasploit-framework/blob/master//modules/exploits/multi/http/phpmyadmin_preg_replace.rb
titlephpMyAdmin Authenticated Remote Code Execution via preg_replace()

Nessus

  • NASL familyFedora Local Security Checks
    NASL idFEDORA_2013-6977.NASL
    descriptionphpMyAdmin 3.5.8.1 (2013-04-24) =============================== - [security] Remote code execution (preg_replace), reported by Janek Vind (see PMASA-2013-2) - [security] Locally Saved SQL Dump File Multiple File Extension Remote Code Execution, reported by Janek Vind (see PMASA-2013-3) Note that Tenable Network Security has extracted the preceding description block directly from the Fedora security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-03-17
    modified2013-05-10
    plugin id66365
    published2013-05-10
    reporterThis script is Copyright (C) 2013-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/66365
    titleFedora 18 : phpMyAdmin-3.5.8.1-1.fc18 (2013-6977)
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from Fedora Security Advisory 2013-6977.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(66365);
      script_version("1.8");
      script_set_attribute(attribute:"plugin_modification_date", value:"2020/03/12");
    
      script_cve_id("CVE-2013-3238", "CVE-2013-3239");
      script_bugtraq_id(59460, 59465);
      script_xref(name:"FEDORA", value:"2013-6977");
    
      script_name(english:"Fedora 18 : phpMyAdmin-3.5.8.1-1.fc18 (2013-6977)");
      script_summary(english:"Checks rpm output for the updated package.");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Fedora host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "phpMyAdmin 3.5.8.1 (2013-04-24) ===============================
    
      - [security] Remote code execution (preg_replace),
        reported by Janek Vind (see PMASA-2013-2)
    
        - [security] Locally Saved SQL Dump File Multiple File
          Extension Remote Code Execution, reported by Janek
          Vind (see PMASA-2013-3)
    
    Note that Tenable Network Security has extracted the preceding
    description block directly from the Fedora security advisory. Tenable
    has attempted to automatically clean and format it as much as possible
    without introducing additional issues."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.redhat.com/show_bug.cgi?id=956398"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.redhat.com/show_bug.cgi?id=956401"
      );
      # https://lists.fedoraproject.org/pipermail/package-announce/2013-May/104770.html
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?5fd709a7"
      );
      script_set_attribute(
        attribute:"solution", 
        value:"Update the affected phpMyAdmin package."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:S/C:P/I:P/A:P");
      script_set_cvss_temporal_vector("CVSS2#E:F/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:"exploit_framework_core", value:"true");
      script_set_attribute(attribute:"metasploit_name", value:'phpMyAdmin Authenticated Remote Code Execution via preg_replace()');
      script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fedoraproject:fedora:phpMyAdmin");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:fedoraproject:fedora:18");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2013/04/30");
      script_set_attribute(attribute:"plugin_publication_date", value:"2013/05/10");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2013-2020 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"Fedora Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/RedHat/release", "Host/RedHat/rpm-list");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/RedHat/release");
    if (isnull(release) || "Fedora" >!< release) audit(AUDIT_OS_NOT, "Fedora");
    os_ver = eregmatch(pattern: "Fedora.*release ([0-9]+)", string:release);
    if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "Fedora");
    os_ver = os_ver[1];
    if (! ereg(pattern:"^18([^0-9]|$)", string:os_ver)) audit(AUDIT_OS_NOT, "Fedora 18.x", "Fedora " + os_ver);
    
    if (!get_kb_item("Host/RedHat/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if ("x86_64" >!< cpu && cpu !~ "^i[3-6]86$") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "Fedora", cpu);
    
    flag = 0;
    if (rpm_check(release:"FC18", reference:"phpMyAdmin-3.5.8.1-1.fc18")) flag++;
    
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:rpm_report_get());
      else security_warning(0);
      exit(0);
    }
    else
    {
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "phpMyAdmin");
    }
    
  • NASL familyFedora Local Security Checks
    NASL idFEDORA_2013-7000.NASL
    descriptionphpMyAdmin 3.5.8.1 (2013-04-24) =============================== - [security] Remote code execution (preg_replace), reported by Janek Vind (see PMASA-2013-2) - [security] Locally Saved SQL Dump File Multiple File Extension Remote Code Execution, reported by Janek Vind (see PMASA-2013-3) Note that Tenable Network Security has extracted the preceding description block directly from the Fedora security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-03-17
    modified2013-05-10
    plugin id66366
    published2013-05-10
    reporterThis script is Copyright (C) 2013-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/66366
    titleFedora 17 : phpMyAdmin-3.5.8.1-1.fc17 (2013-7000)
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from Fedora Security Advisory 2013-7000.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(66366);
      script_version("1.8");
      script_set_attribute(attribute:"plugin_modification_date", value:"2020/03/12");
    
      script_cve_id("CVE-2013-3238", "CVE-2013-3239");
      script_bugtraq_id(59460, 59465);
      script_xref(name:"FEDORA", value:"2013-7000");
    
      script_name(english:"Fedora 17 : phpMyAdmin-3.5.8.1-1.fc17 (2013-7000)");
      script_summary(english:"Checks rpm output for the updated package.");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Fedora host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "phpMyAdmin 3.5.8.1 (2013-04-24) ===============================
    
      - [security] Remote code execution (preg_replace),
        reported by Janek Vind (see PMASA-2013-2)
    
        - [security] Locally Saved SQL Dump File Multiple File
          Extension Remote Code Execution, reported by Janek
          Vind (see PMASA-2013-3)
    
    Note that Tenable Network Security has extracted the preceding
    description block directly from the Fedora security advisory. Tenable
    has attempted to automatically clean and format it as much as possible
    without introducing additional issues."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.redhat.com/show_bug.cgi?id=956398"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.redhat.com/show_bug.cgi?id=956401"
      );
      # https://lists.fedoraproject.org/pipermail/package-announce/2013-May/104725.html
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?d5a68feb"
      );
      script_set_attribute(
        attribute:"solution", 
        value:"Update the affected phpMyAdmin package."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:S/C:P/I:P/A:P");
      script_set_cvss_temporal_vector("CVSS2#E:F/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:"exploit_framework_core", value:"true");
      script_set_attribute(attribute:"metasploit_name", value:'phpMyAdmin Authenticated Remote Code Execution via preg_replace()');
      script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fedoraproject:fedora:phpMyAdmin");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:fedoraproject:fedora:17");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2013/04/30");
      script_set_attribute(attribute:"plugin_publication_date", value:"2013/05/10");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2013-2020 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"Fedora Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/RedHat/release", "Host/RedHat/rpm-list");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/RedHat/release");
    if (isnull(release) || "Fedora" >!< release) audit(AUDIT_OS_NOT, "Fedora");
    os_ver = eregmatch(pattern: "Fedora.*release ([0-9]+)", string:release);
    if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "Fedora");
    os_ver = os_ver[1];
    if (! ereg(pattern:"^17([^0-9]|$)", string:os_ver)) audit(AUDIT_OS_NOT, "Fedora 17.x", "Fedora " + os_ver);
    
    if (!get_kb_item("Host/RedHat/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if ("x86_64" >!< cpu && cpu !~ "^i[3-6]86$") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "Fedora", cpu);
    
    flag = 0;
    if (rpm_check(release:"FC17", reference:"phpMyAdmin-3.5.8.1-1.fc17")) flag++;
    
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:rpm_report_get());
      else security_warning(0);
      exit(0);
    }
    else
    {
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "phpMyAdmin");
    }
    
  • NASL familyFreeBSD Local Security Checks
    NASL idFREEBSD_PKG_8C8FA44DAD1511E28CEA6805CA0B3D42.NASL
    descriptionThe phpMyAdmin development team reports : In some PHP versions, the preg_replace() function can be tricked into executing arbitrary PHP code on the server. This is done by passing a crafted argument as the regular expression, containing a null byte. phpMyAdmin does not correctly sanitize an argument passed to preg_replace() when using the
    last seen2020-06-01
    modified2020-06-02
    plugin id66210
    published2013-04-25
    reporterThis script is Copyright (C) 2013-2018 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/66210
    titleFreeBSD : phpMyAdmin -- Multiple security vulnerabilities (8c8fa44d-ad15-11e2-8cea-6805ca0b3d42)
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from the FreeBSD VuXML database :
    #
    # Copyright 2003-2018 Jacques Vidrine and contributors
    #
    # Redistribution and use in source (VuXML) and 'compiled' forms (SGML,
    # HTML, PDF, PostScript, RTF and so forth) with or without modification,
    # are permitted provided that the following conditions are met:
    # 1. Redistributions of source code (VuXML) must retain the above
    #    copyright notice, this list of conditions and the following
    #    disclaimer as the first lines of this file unmodified.
    # 2. Redistributions in compiled form (transformed to other DTDs,
    #    published online in any format, converted to PDF, PostScript,
    #    RTF and other formats) must reproduce the above copyright
    #    notice, this list of conditions and the following disclaimer
    #    in the documentation and/or other materials provided with the
    #    distribution.
    # 
    # THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS"
    # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
    # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
    # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
    # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
    # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
    # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION,
    # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(66210);
      script_version("1.5");
      script_cvs_date("Date: 2018/11/10 11:49:43");
    
      script_cve_id("CVE-2013-3238", "CVE-2013-3239");
    
      script_name(english:"FreeBSD : phpMyAdmin -- Multiple security vulnerabilities (8c8fa44d-ad15-11e2-8cea-6805ca0b3d42)");
      script_summary(english:"Checks for updated package in pkg_info output");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote FreeBSD host is missing a security-related update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "The phpMyAdmin development team reports :
    
    In some PHP versions, the preg_replace() function can be tricked into
    executing arbitrary PHP code on the server. This is done by passing a
    crafted argument as the regular expression, containing a null byte.
    phpMyAdmin does not correctly sanitize an argument passed to
    preg_replace() when using the 'Replace table prefix' feature, opening
    the way to this vulnerability..
    
    This vulnerability can be triggered only by someone who logged in to
    phpMyAdmin, as the usual token protection prevents non-logged-in users
    to access the required form.
    
    phpMyAdmin can be configured to save an export file on the web server,
    via its SaveDir directive. With this in place, it's possible, either
    via a crafted filename template or a crafted table name, to save a
    double extension file like foobar.php.sql. In turn, an Apache
    webserver on which there is no definition for the MIME type 'sql' (the
    default) will treat this saved file as a '.php' script, leading to
    remote code execution.
    
    This vulnerability can be triggered only by someone who logged in to
    phpMyAdmin, as the usual token protection prevents non-logged-in users
    to access the required form. Moreover, the SaveDir directive is empty
    by default, so a default configuration is not vulnerable. The
    $cfg['SaveDir'] directive must be configured, and the server must be
    running Apache with mod_mime to be exploitable."
      );
      # https://vuxml.freebsd.org/freebsd/8c8fa44d-ad15-11e2-8cea-6805ca0b3d42.html
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?1a93aba0"
      );
      script_set_attribute(attribute:"solution", value:"Update the affected package.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:S/C:P/I:P/A:P");
      script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"true");
      script_set_attribute(attribute:"exploit_framework_core", value:"true");
      script_set_attribute(attribute:"metasploit_name", value:'phpMyAdmin Authenticated Remote Code Execution via preg_replace()');
      script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:freebsd:freebsd:phpMyAdmin");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:freebsd:freebsd");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2013/04/24");
      script_set_attribute(attribute:"patch_publication_date", value:"2013/04/24");
      script_set_attribute(attribute:"plugin_publication_date", value:"2013/04/25");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2013-2018 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"FreeBSD Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/FreeBSD/release", "Host/FreeBSD/pkg_info");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("freebsd_package.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    if (!get_kb_item("Host/FreeBSD/release")) audit(AUDIT_OS_NOT, "FreeBSD");
    if (!get_kb_item("Host/FreeBSD/pkg_info")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    
    flag = 0;
    
    if (pkg_test(save_report:TRUE, pkg:"phpMyAdmin>=3.5<3.5.8.1")) flag++;
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:pkg_report_get());
      else security_warning(0);
      exit(0);
    }
    else audit(AUDIT_HOST_NOT, "affected");
    
  • NASL familyGentoo Local Security Checks
    NASL idGENTOO_GLSA-201311-02.NASL
    descriptionThe remote host is affected by the vulnerability described in GLSA-201311-02 (phpMyAdmin: Multiple vulnerabilities) Multiple vulnerabilities have been discovered in phpMyAdmin. Please review the CVE identifiers referenced below for details. Impact : A remote authenticated attacker could exploit these vulnerabilities to execute arbitrary code with the privileges of the process running phpMyAdmin, inject SQL code, or to conduct Cross-Site Scripting and Clickjacking attacks. Workaround : There is no known workaround at this time.
    last seen2020-06-01
    modified2020-06-02
    plugin id70753
    published2013-11-05
    reporterThis script is Copyright (C) 2013-2018 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/70753
    titleGLSA-201311-02 : phpMyAdmin: Multiple vulnerabilities
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were
    # extracted from Gentoo Linux Security Advisory GLSA 201311-02.
    #
    # The advisory text is Copyright (C) 2001-2018 Gentoo Foundation, Inc.
    # and licensed under the Creative Commons - Attribution / Share Alike 
    # license. See http://creativecommons.org/licenses/by-sa/3.0/
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(70753);
      script_version("1.9");
      script_cvs_date("Date: 2018/07/13 15:08:46");
    
      script_cve_id("CVE-2013-1937", "CVE-2013-3238", "CVE-2013-3239", "CVE-2013-4995", "CVE-2013-4996", "CVE-2013-4997", "CVE-2013-4998", "CVE-2013-4999", "CVE-2013-5000", "CVE-2013-5001", "CVE-2013-5002", "CVE-2013-5003", "CVE-2013-5029");
      script_bugtraq_id(58962, 59460, 59465, 61510, 61511, 61512, 61513, 61515, 61516, 61804, 61919, 61921, 61923);
      script_xref(name:"GLSA", value:"201311-02");
    
      script_name(english:"GLSA-201311-02 : phpMyAdmin: Multiple vulnerabilities");
      script_summary(english:"Checks for updated package(s) in /var/db/pkg");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:
    "The remote Gentoo host is missing one or more security-related
    patches."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "The remote host is affected by the vulnerability described in GLSA-201311-02
    (phpMyAdmin: Multiple vulnerabilities)
    
        Multiple vulnerabilities have been discovered in phpMyAdmin. Please
          review the CVE identifiers referenced below for details.
      
    Impact :
    
        A remote authenticated attacker could exploit these vulnerabilities to
          execute arbitrary code with the privileges of the process running
          phpMyAdmin, inject SQL code, or to conduct Cross-Site Scripting and
          Clickjacking attacks.
      
    Workaround :
    
        There is no known workaround at this time."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://security.gentoo.org/glsa/201311-02"
      );
      script_set_attribute(
        attribute:"solution", 
        value:
    "All phpMyAdmin users should upgrade to the latest version:
          # emerge --sync
          # emerge --ask --oneshot --verbose '>=dev-db/phpmyadmin-4.0.5'"
      );
      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:F/RL:OF/RC:C");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N");
      script_set_cvss3_temporal_vector("CVSS:3.0/E:F/RL:O/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"true");
      script_set_attribute(attribute:"exploit_framework_core", value:"true");
      script_set_attribute(attribute:"metasploit_name", value:'phpMyAdmin Authenticated Remote Code Execution via preg_replace()');
      script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:gentoo:linux:phpmyadmin");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:gentoo:linux");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2013/11/04");
      script_set_attribute(attribute:"plugin_publication_date", value:"2013/11/05");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2013-2018 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"Gentoo Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/Gentoo/release", "Host/Gentoo/qpkg-list");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("qpkg.inc");
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    if (!get_kb_item("Host/Gentoo/release")) audit(AUDIT_OS_NOT, "Gentoo");
    if (!get_kb_item("Host/Gentoo/qpkg-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    
    flag = 0;
    
    if (qpkg_check(package:"dev-db/phpmyadmin", unaffected:make_list("ge 4.0.5"), vulnerable:make_list("lt 4.0.5"))) flag++;
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:qpkg_report_get());
      else security_warning(0);
      exit(0);
    }
    else
    {
      tested = qpkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "phpMyAdmin");
    }
    
  • NASL familyCGI abuses
    NASL idPHPMYADMIN_PMASA_2013_2.NASL
    descriptionAccording to its self-identified version number, the phpMyAdmin 3.5.x / 4.0.0 install hosted on the remote web server is earlier than 3.5.8.1 / 4.0.0-rc3 and is, therefore, affected by multiple vulnerabilities: - The
    last seen2020-06-01
    modified2020-06-02
    plugin id66295
    published2013-05-02
    reporterThis script is Copyright (C) 2013-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/66295
    titlephpMyAdmin 3.5.x < 3.5.8.1 / 4.x < 4.0.0-rc3 Multiple Vulnerabilities (PMASA-2013-2 - PMASA-2013-5
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(66295);
      script_version("1.7");
      script_cvs_date("Date: 2019/11/27");
    
      script_cve_id(
        "CVE-2013-3238",
        "CVE-2013-3239",
        "CVE-2013-3240",
        "CVE-2013-3241"
      );
      script_bugtraq_id(
        59460,
        59461,
        59462,
        59465
      );
      script_xref(name:"EDB-ID", value:"25003");
    
      script_name(english:"phpMyAdmin 3.5.x < 3.5.8.1 / 4.x < 4.0.0-rc3 Multiple Vulnerabilities (PMASA-2013-2 - PMASA-2013-5");
      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
    multiple vulnerabilities.");
      script_set_attribute(attribute:"description", value:
    "According to its self-identified version number, the phpMyAdmin 3.5.x /
    4.0.0 install hosted on the remote web server is earlier than 3.5.8.1 /
    4.0.0-rc3 and is, therefore, affected by multiple vulnerabilities:
    
      - The 'preg_replace' fails to properly sanitize
        arguments, which can be used to for arbitrary code
        execution. (CVE-2013-3238)
    
      - A security weakness exists in the way that locally saved
        databases are handled.  It is possible that the
        'filename_template' parameter can be used to create a
        file with double extensions. (CVE-2013-3239)
    
      - A flaw exists where the 'what' parameter was not
        correctly validated, allowing for a local file
        inclusion. This flaw reportedly affects phpMyAdmin 4.x
        only. (CVE-2013-3240)
    
      - A flaw exists in the 'export.php' script that allows
        overwrite of global variables, leading to an
        unauthorized access vulnerability. This flaw reportedly
        affects phpMyAdmin 4.x only. (CVE-2013-3241)");
      script_set_attribute(attribute:"see_also", value:"https://www.phpmyadmin.net/security/PMASA-2013-2/");
      script_set_attribute(attribute:"see_also", value:"https://www.phpmyadmin.net/security/PMASA-2013-3/");
      script_set_attribute(attribute:"see_also", value:"https://www.phpmyadmin.net/security/PMASA-2013-4/");
      script_set_attribute(attribute:"see_also", value:"https://www.phpmyadmin.net/security/PMASA-2013-5/");
      script_set_attribute(attribute:"see_also", value:"http://www.waraxe.us/advisory-103.html");
      script_set_attribute(attribute:"solution", value:
    "Either upgrade to phpMyAdmin 3.5.8.1 / 4.0.0-rc3 or later, or apply the
    patches from the referenced link.");
      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:F/RL:OF/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:"exploit_framework_core", value:"true");
      script_set_attribute(attribute:"metasploit_name", value:'phpMyAdmin Authenticated Remote Code Execution via preg_replace()');
      script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2013/04/24");
      script_set_attribute(attribute:"patch_publication_date", value:"2013/04/24");
      script_set_attribute(attribute:"plugin_publication_date", value:"2013/05/02");
    
      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-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
    
      script_dependencies("phpMyAdmin_detect.nasl");
      script_require_keys("www/PHP", "www/phpMyAdmin", "Settings/ParanoidReport");
      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");
    
    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 =~ "^3(\.5)?$" ||
      version =~ "^4(\.0)?$"
    ) exit(1, "The version of phpMyAdmin located at "+ location +" ("+ version +") is not granular enough.");
    
    if (
      # 3.5.x < 3.5.8.1
      version =~ "^3\.5\.[0-7]([^0-9]|$)" ||
      version =~ "^3\.5\.8($|\.[^1-9])" ||
      # 4.0.0 < 4.0.0-rc3
      version =~ "^4\.0\.0-rc[0-2]([^0-9]|$)"
    )
    {
      if (report_verbosity > 0)
      {
        report =
          '\n  URL               : ' + location +
          '\n  Installed version : ' + version +
          '\n  Fixed version     : 3.5.8.1 / 4.0.0-rc3' +
          '\n';
        security_warning(port:port, extra:report);
      }
      else security_warning(port);
      exit(0);
    }
    else audit(AUDIT_WEB_APP_NOT_AFFECTED, "phpMyAdmin", location, version);
    
  • NASL familySuSE Local Security Checks
    NASL idOPENSUSE-2013-524.NASL
    descriptionThis update of phpMyAdmin fixes several security issues. - update to 3.5.8.1 (2013-04-24) - [security] Remote code execution (preg_replace), reported by Janek Vind (see PMASA-2013-2) - [security] Locally Saved SQL Dump File Multiple File Extension Remote Code Execution, reported by Janek Vind (see PMASA-2013-3) - fix for bnc#824301 - PMASA-2013-2 (CVE-2013-3238) - fix for bnc#824302 - PMASA-2013-3 (CVE-2013-3239) - update to 3.5.8 (2013-04-08) - sf#3828 MariaDB reported as MySQL - sf#3854 Incorrect header for Safari 6.0 - sf#3705 Attempt to open trigger for edit gives NULL - Use HTML5 DOCTYPE - [security] Self-XSS on GIS visualisation page, reported by Janek Vind see PMASA-2013-1 - sf#3800 Incorrect keyhandler behaviour #2 - fix for bnc#814678 - PMASA-2013-1 (CVE-2013-1937)
    last seen2020-06-05
    modified2014-06-13
    plugin id75055
    published2014-06-13
    reporterThis script is Copyright (C) 2014-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/75055
    titleopenSUSE Security Update : phpMyAdmin (openSUSE-SU-2013:1065-1)
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were
    # extracted from openSUSE Security Update openSUSE-2013-524.
    #
    # The text description of this plugin is (C) SUSE LLC.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(75055);
      script_version("1.5");
      script_set_attribute(attribute:"plugin_modification_date", value:"2020/06/04");
    
      script_cve_id("CVE-2013-1937", "CVE-2013-3238", "CVE-2013-3239");
    
      script_name(english:"openSUSE Security Update : phpMyAdmin (openSUSE-SU-2013:1065-1)");
      script_summary(english:"Check for the openSUSE-2013-524 patch");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote openSUSE host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "This update of phpMyAdmin fixes several security issues.
    
      - update to 3.5.8.1 (2013-04-24)
    
      - [security] Remote code execution (preg_replace),
        reported by Janek Vind (see PMASA-2013-2)
    
      - [security] Locally Saved SQL Dump File Multiple File
        Extension Remote Code Execution, reported by Janek Vind
        (see PMASA-2013-3)
    
      - fix for bnc#824301
    
      - PMASA-2013-2 (CVE-2013-3238)
    
      - fix for bnc#824302
    
      - PMASA-2013-3 (CVE-2013-3239)
    
      - update to 3.5.8 (2013-04-08)
    
      - sf#3828 MariaDB reported as MySQL
    
      - sf#3854 Incorrect header for Safari 6.0
    
      - sf#3705 Attempt to open trigger for edit gives NULL
    
      - Use HTML5 DOCTYPE
    
      - [security] Self-XSS on GIS visualisation page, reported
        by Janek Vind see PMASA-2013-1
    
      - sf#3800 Incorrect keyhandler behaviour #2
    
      - fix for bnc#814678
    
      - PMASA-2013-1 (CVE-2013-1937)"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.novell.com/show_bug.cgi?id=814678"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.novell.com/show_bug.cgi?id=824301"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.novell.com/show_bug.cgi?id=824302"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://lists.opensuse.org/opensuse-updates/2013-06/msg00181.html"
      );
      script_set_attribute(
        attribute:"solution", 
        value:"Update the affected phpMyAdmin package."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:S/C:P/I:P/A:P");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N");
      script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"true");
      script_set_attribute(attribute:"exploit_framework_core", value:"true");
      script_set_attribute(attribute:"metasploit_name", value:'phpMyAdmin Authenticated Remote Code Execution via preg_replace()');
      script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:novell:opensuse:phpMyAdmin");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:novell:opensuse:12.2");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:novell:opensuse:12.3");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2013/06/13");
      script_set_attribute(attribute:"plugin_publication_date", value:"2014/06/13");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2014-2020 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"SuSE Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/SuSE/release", "Host/SuSE/rpm-list");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/SuSE/release");
    if (isnull(release) || release =~ "^(SLED|SLES)") audit(AUDIT_OS_NOT, "openSUSE");
    if (release !~ "^(SUSE12\.2|SUSE12\.3)$") audit(AUDIT_OS_RELEASE_NOT, "openSUSE", "12.2 / 12.3", release);
    if (!get_kb_item("Host/SuSE/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    
    
    flag = 0;
    
    if ( rpm_check(release:"SUSE12.2", reference:"phpMyAdmin-3.5.8.1-1.12.1") ) flag++;
    if ( rpm_check(release:"SUSE12.3", reference:"phpMyAdmin-3.5.8.1-1.4.1") ) flag++;
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:rpm_report_get());
      else security_warning(0);
      exit(0);
    }
    else
    {
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "phpMyAdmin");
    }
    
  • NASL familyFedora Local Security Checks
    NASL idFEDORA_2013-6928.NASL
    descriptionphpMyAdmin 3.5.8.1 (2013-04-24) =============================== - [security] Remote code execution (preg_replace), reported by Janek Vind (see PMASA-2013-2) - [security] Locally Saved SQL Dump File Multiple File Extension Remote Code Execution, reported by Janek Vind (see PMASA-2013-3) Note that Tenable Network Security has extracted the preceding description block directly from the Fedora security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-03-17
    modified2013-05-10
    plugin id66364
    published2013-05-10
    reporterThis script is Copyright (C) 2013-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/66364
    titleFedora 19 : phpMyAdmin-3.5.8.1-1.fc19 (2013-6928)
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from Fedora Security Advisory 2013-6928.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(66364);
      script_version("1.9");
      script_set_attribute(attribute:"plugin_modification_date", value:"2020/03/12");
    
      script_cve_id("CVE-2013-3238", "CVE-2013-3239");
      script_bugtraq_id(59460, 59465);
      script_xref(name:"FEDORA", value:"2013-6928");
    
      script_name(english:"Fedora 19 : phpMyAdmin-3.5.8.1-1.fc19 (2013-6928)");
      script_summary(english:"Checks rpm output for the updated package.");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Fedora host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "phpMyAdmin 3.5.8.1 (2013-04-24) ===============================
    
      - [security] Remote code execution (preg_replace),
        reported by Janek Vind (see PMASA-2013-2)
    
        - [security] Locally Saved SQL Dump File Multiple File
          Extension Remote Code Execution, reported by Janek
          Vind (see PMASA-2013-3)
    
    Note that Tenable Network Security has extracted the preceding
    description block directly from the Fedora security advisory. Tenable
    has attempted to automatically clean and format it as much as possible
    without introducing additional issues."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.redhat.com/show_bug.cgi?id=956398"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugzilla.redhat.com/show_bug.cgi?id=956401"
      );
      # https://lists.fedoraproject.org/pipermail/package-announce/2013-May/104936.html
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?7b43e6f5"
      );
      script_set_attribute(
        attribute:"solution", 
        value:"Update the affected phpMyAdmin package."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:S/C:P/I:P/A:P");
      script_set_cvss_temporal_vector("CVSS2#E:F/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:"exploit_framework_core", value:"true");
      script_set_attribute(attribute:"metasploit_name", value:'phpMyAdmin Authenticated Remote Code Execution via preg_replace()');
      script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fedoraproject:fedora:phpMyAdmin");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:fedoraproject:fedora:19");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2013/04/29");
      script_set_attribute(attribute:"plugin_publication_date", value:"2013/05/10");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2013-2020 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"Fedora Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/RedHat/release", "Host/RedHat/rpm-list");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/RedHat/release");
    if (isnull(release) || "Fedora" >!< release) audit(AUDIT_OS_NOT, "Fedora");
    os_ver = eregmatch(pattern: "Fedora.*release ([0-9]+)", string:release);
    if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "Fedora");
    os_ver = os_ver[1];
    if (! ereg(pattern:"^19([^0-9]|$)", string:os_ver)) audit(AUDIT_OS_NOT, "Fedora 19.x", "Fedora " + os_ver);
    
    if (!get_kb_item("Host/RedHat/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if ("x86_64" >!< cpu && cpu !~ "^i[3-6]86$") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "Fedora", cpu);
    
    flag = 0;
    if (rpm_check(release:"FC19", reference:"phpMyAdmin-3.5.8.1-1.fc19")) flag++;
    
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:rpm_report_get());
      else security_warning(0);
      exit(0);
    }
    else
    {
      tested = pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "phpMyAdmin");
    }
    
  • NASL familyMandriva Local Security Checks
    NASL idMANDRIVA_MDVSA-2013-160.NASL
    descriptionUpdated phpmyadmin package fixes security vulnerabilities : In some PHP versions, the preg_replace\(\) function can be tricked into executing arbitrary PHP code on the server. This is done by passing a crafted argument as the regular expression, containing a null byte. phpMyAdmin does not correctly sanitize an argument passed to preg_replace\(\) when using the Replace table prefix feature, opening the way to this vulnerability (CVE-2013-3238). phpMyAdmin can be configured to save an export file on the web server, via its SaveDir directive. With this in place, it
    last seen2020-06-01
    modified2020-06-02
    plugin id66313
    published2013-05-04
    reporterThis script is Copyright (C) 2013-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/66313
    titleMandriva Linux Security Advisory : phpmyadmin (MDVSA-2013:160)
    code
    #%NASL_MIN_LEVEL 80502
    
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from Mandriva Linux Security Advisory MDVSA-2013:160. 
    # The text itself is copyright (C) Mandriva S.A.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(66313);
      script_version("1.9");
      script_cvs_date("Date: 2019/08/02 13:32:55");
    
      script_cve_id("CVE-2013-3238", "CVE-2013-3239");
      script_bugtraq_id(59460, 59465);
      script_xref(name:"MDVSA", value:"2013:160");
      script_xref(name:"MGASA", value:"2013-0133");
    
      script_name(english:"Mandriva Linux Security Advisory : phpmyadmin (MDVSA-2013:160)");
      script_summary(english:"Checks rpm output for the updated package");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Mandriva Linux host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "Updated phpmyadmin package fixes security vulnerabilities :
    
    In some PHP versions, the preg_replace\(\) function can be tricked
    into executing arbitrary PHP code on the server. This is done by
    passing a crafted argument as the regular expression, containing a
    null byte. phpMyAdmin does not correctly sanitize an argument passed
    to preg_replace\(\) when using the Replace table prefix feature,
    opening the way to this vulnerability (CVE-2013-3238).
    
    phpMyAdmin can be configured to save an export file on the web server,
    via its SaveDir directive. With this in place, it's possible, either
    via a crafted filename template or a crafted table name, to save a
    double extension file like foobar.php.sql. In turn, an Apache
    webserver on which there is no definition for the MIME type sql (the
    default) will treat this saved file as a .php script, leading to
    remote code execution (CVE-2013-3239)."
      );
      script_set_attribute(
        attribute:"solution", 
        value:"Update the affected phpmyadmin package."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:S/C:P/I:P/A:P");
      script_set_cvss_temporal_vector("CVSS2#E:F/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:"exploit_framework_core", value:"true");
      script_set_attribute(attribute:"metasploit_name", value:'phpMyAdmin Authenticated Remote Code Execution via preg_replace()');
      script_set_attribute(attribute:"exploit_framework_metasploit", value:"true");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:mandriva:linux:phpmyadmin");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:mandriva:business_server:1");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2013/05/03");
      script_set_attribute(attribute:"plugin_publication_date", value:"2013/05/04");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2013-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"Mandriva Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/cpu", "Host/Mandrake/release", "Host/Mandrake/rpm-list");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    if (!get_kb_item("Host/Mandrake/release")) audit(AUDIT_OS_NOT, "Mandriva / Mandake Linux");
    if (!get_kb_item("Host/Mandrake/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if (cpu !~ "^(amd64|i[3-6]86|x86_64)$") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "Mandriva / Mandrake Linux", cpu);
    
    
    flag = 0;
    if (rpm_check(release:"MDK-MBS1", reference:"phpmyadmin-3.5.8.1-0.1.mbs1")) flag++;
    
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:rpm_report_get());
      else security_warning(0);
      exit(0);
    }
    else audit(AUDIT_HOST_NOT, "affected");
    

Packetstorm

Saint

bid59460
descriptionphpMyAdmin preg_replace from_prefix sanitization vulnerability
idweb_prog_php_myadminver
osvdb92793
titlephpmyadmin_preg_replace_argument_sanitization
typeremote

Seebug

  • bulletinFamilyexploit
    descriptionBUGTRAQ ID: 59460 CVE(CAN) ID: CVE-2013-3238 phpmyadmin是MySQL数据库的在线管理工具,主要功能包括在线创建数据表、运行SQL语句、搜索查询数据以及导入导出数据等。 phpMyAdmin 3.5.8、4.0.0-rc2及其他版本的preg_replace()函数可被利用在服务器端执行任意PHP代码,攻击者用特制参数作为常规表达式,在此表达式内包含空字节,当phpMyAdmin使用&quot;Replace table prefix&quot;功能时,会错误地过滤传递到preg_replace()的特制参数。导致在Web服务器上下文中执行任意PHP代码。 0 phpMyAdmin &lt; 3.5.8.1
    idSSV:60769
    last seen2017-11-19
    modified2013-04-28
    published2013-04-28
    reporterRoot
    sourcehttps://www.seebug.org/vuldb/ssvid-60769
    titlephpMyAdmin preg_replace()远程PHP代码执行
  • bulletinFamilyexploit
    descriptionNo description provided by source.
    idSSV:78670
    last seen2017-11-19
    modified2014-07-01
    published2014-07-01
    reporterRoot
    sourcehttps://www.seebug.org/vuldb/ssvid-78670
    titlephpMyAdmin 3.5.8 and 4.0.0-RC2 - Multiple Vulnerabilities