Drupal 7.14 & lt; = full path Leakage

Source: Internet
Author: User
Tags drupal microsoft iis

Drupal 7.14 <= Full Path Disclosure Vulnerability
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 between des/bootstrap. inc, line 2695:

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

Function request_path (){
Static $ path;

If (isset ($ path )){
Return $ path;
}

If (isset ($ _ GET ['q']) {
// This is a request with? 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 CILS.
$ 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
// $ _ 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 = ''; www.2cto.com
}

// 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://www.2cto.com /? Q [] = x

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

Solution:
Search:

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

And add the following line above:

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

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.