Drupal 7.14 <= Full Path Disclosure Vulnerability

简介: #################################################Drupal 7.14
#################################################
Drupal 7.14 <= Full Path Disclosure Vulnerability
#################################################

Discovered by: Jean Pascal Pereira <pereira (at) secbiz (dot) de [email concealed]>

About Drupal:

"Drupal is an open source content management platform powering millions of websites and
applications. It's built, used, and supported by an active and diverse community of people
around the world."

Drupal is used by common companies like Ing/Diba, Amnesty International and The White House.

#################################################

Issue: Full Path Disclosure

Risk-level: Medium

The remote attacker has the possibility to detect the full local path of drupal.
This information can be used for processing further attacks against the server.

In includes/bootstrap.inc, line 2695:

-------------------------------------

function request_path() {
static $path;

if (isset($path)) {
return $path;
}

if (isset($_GET['q'])) {
// This is a request with a ?q=foo/bar query string. $_GET['q'] is
// overwritten in drupal_path_initialize(), but request_path() is called
// very early in the bootstrap process, so the original value is saved in
// $path and returned in later calls.
$path = $_GET['q'];
}
elseif (isset($_SERVER['REQUEST_URI'])) {
// This request is either a clean URL, or 'index.php', or nonsense.
// Extract the path from REQUEST_URI.
$request_path = strtok($_SERVER['REQUEST_URI'], '?');
$base_path_len = strlen(rtrim(dirname($_SERVER['SCRIPT_NAME']), '\/'));
// Unescape and strip $base_path prefix, leaving q without a leading slash.
$path = substr(urldecode($request_path), $base_path_len + 1);
// If the path equals the script filename, either because 'index.php' was
// explicitly provided in the URL, or because the server added it to
// $_SERVER['REQUEST_URI'] even when it wasn't provided in the URL (some
// versions of Microsoft IIS do this), the front page should be served.
if ($path == basename($_SERVER['PHP_SELF'])) {
$path = '';
}
}
else {
// This is the front page.
$path = '';
}

// Under certain conditions Apache's RewriteRule directive prepends the value
// assigned to $_GET['q'] with a slash. Moreover we can always have a trailing
// slash in place, hence we need to normalize $_GET['q'].
$path = trim($path, '/');

return $path;
}

-------------------------------------

Exploit / Proof Of Concept:

http://localhost/?q[]=x

-------------------------------------

Hotfix:

Search for:

$path = trim($path, '/');

And add the following line above:

if(is_array($path)) { die(); }

-------------------------------------

########################################################################
#####################

目录
相关文章
Basic Mathematics You Should Mastered
Basic Mathematics You Should Mastered 2017-08-17  21:22:40    1. Statistical distance  In statistics, probability theory, and information theory, ...
Secure Multi-party Computation
https://en.wikipedia.org/wiki/Secure_multi-party_computation ...
1076 0
[Papers]NSE, $\p_3u$, multiplier spaces [Guo-Gala, ANAP, 2013]
$$\bex \p_3\bbu\in L^\frac{2}{1-r}(0,T;\dot X_r(\bbR^3)),\quad 0\leq r\leq 1. \eex$$
697 0
|
SQL Go 关系型数据库
Multiple vulnerabilities in Cacti 0.8.8b and lower
The following are XSS and SQL Injection vulnerabilities I've found in the latest version of Cacti (0.
906 0
|
SQL 安全 PHP
[waraxe-2013-SA#103] - Multiple Vulnerabilities in phpMyAdmin
Author: Janek Vind "waraxe"Date: 25. April 2013Location: Estonia, TartuWeb: http://www.
718 0
|
JavaScript 内存技术
Vulnerabilities in SWFUpload in multiple web applications: WordPress, Dotclear, InstantCMS, AionWeb
Hello list! Earlier I've wrote about Content Spoofing and Cross-Site Scripting vulnerabilities in SWFUpload (http://securityvulns.
942 0
Multiple Products Cookie Authentication Bypass Vulnerability
http://downloads.securityfocus.com/vulnerabilities/exploits/55234.
771 0
|
SQL 安全 传感器
Checking For Vulnerabilities in Path Fragments
http://www.acunetix.com/blog/web-security-zone/articles/web-vulnerabilities-path-fragments/?ut...
975 0
|
应用服务中间件 Apache
Apache Tomcat information disclosure vulnerability
 CVE-2010-1157: Apache Tomcat information disclosure vulnerability Severity: Low Vendor: The Ap...
836 0