[2012-4-10] thinkphp framework exploded arbitrary code execution vulnerability

Source: Internet
Author: User

Yesterday (2012.04.09) thinkphp Framework was burst out of a PHP code arbitrary execution vulnerability, hackers only need to submit a special URL to execute malicious code on the site.

Thinkphp as a domestic use of the more extensive old PHP MVC framework, there are many start-ups or projects have used this framework. However, most developers and users do not notice the vulnerability of the vulnerabilities, warning: This vulnerability is a very serious problem, as long as the use of the thinkphp framework, you can directly execute arbitrary PHP code , Use the thinkphp framework of the webmaster quickly to their own website into the detection, and repair.

Repair method:

1, download the official release of the Patch:

http://code.google.com/p/thinkphp/source/detail?spec=svn2904&r=2838

2, or directly modify the source code:

/trunk/thinkphp/lib/core/dispatcher.class.php

$res = Preg_replace (' @ (w+) '. $depr. ' ([^ '. $depr. ' /]+) @e ', ' $var [' \1 ']= ' \2 '; ', implode ($DEPR, $paths));

Revision changed to

$res = Preg_replace (' @ (w+) '. $depr. ' ([^ '. $depr. ' /]+) @e ', ' $var [' \1 ']= ' \2 '; ', implode ($DEPR, $paths));

Change the double quotation mark in preg_replace second argument to single quotation mark to prevent PHP variable syntax from being parsed.

[2012-4-10] thinkphp framework exploded arbitrary code execution vulnerability

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.