DedeCMSV53 arbitrary variable Overwrite Vulnerability

Source: Internet
Author: User

Today, I saw an article about mr_xhming.

DedeCMSV53 arbitrary variable Overwrite Vulnerability

BY flyh4t
Http://www.wolvez.org
2008-12-12

DedeCMSV53 is released, but the variable overwrite vulnerability is not completely fixed. This vulnerability is similar to the ryat one :)
Check the code in the Core File include/common. inc. php.

PHP code
// Check and register external submitted Variables
Foreach ($ _ REQUEST as $ _ k => $ _ v)
{
If (strlen ($ _ k)> 0 & eregi (^ (_ | cfg _ | GLOBALS), $ _ k )&&! Isset ($ _ COOKIE [$ _ k]) // is the programmer's logic confused?
{
Exit (Request var not allow !);
}
}

In this case, you can use the submit _ COOKIE variable to bypass the filtering of cfg _ and other keywords.
The next step is to register the variable code

PHP code
Foreach (Array (_ GET, _ POST, _ COOKIE) as $ _ request)
{
Foreach ($ _ request as $ _ k = >$ _ v) $ {$ _ k} = _ RunMagicQuotes ($ _ v );
}

Then initialize the variable

 

// Database Configuration File
Require_once (DEDEDATA./common. inc. php );

// System configuration parameters
Require_once (DEDEDATA. "/config. cache. inc. php"); it seems that it cannot be used, but fortunately there is such a piece of code at the end of the file

// Convert the variables related to the uploaded files and perform security processing, and reference the common upload functions at the front end.
If ($ _ FILES)
{
Require_once (DEDEINC./uploadsafe. inc. php );
} Let's see What uploadsafe. inc. php provides for us.

PHP code
$ Keyarr = array (name, type, tmp_name, size );

Foreach ($ _ FILES as $ _ key = >$ _ value)
{
Foreach ($ keyarr as $ k)
{
If (! Isset ($ _ FILES [$ _ key] [$ k])
{
Exit (Request Error !);
}
}
$ _ Key = $ _ FILES [$ _ key] [tmp_name] = str_replace ("\\","\", $ _ FILES [$ _ key] [tmp_name]);
// Note that through the common. inc. php vulnerability, we can control $ _ FILES [$ _ key] [tmp_name ].
Here, by submitting common. inc. php? _ FILES [pai_xxxx] [tmp_name] = aaaaaa &...... To overwrite ipv_xxxx
Pay attention to assigning values to cookies when using them, and bypass some judgments in uploadsafe. inc. php.


 

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.