WordPress website "HTTP response splitting vulnerability" security problem solution

Source: Internet
Author: User
Tags php file
Generally, when operating and maintaining a website, we use a third-party online monitoring tool to check whether the website has certain risks. We can also directly monitor risk vulnerabilities, if any security risks of the website are discovered, the website will be sent to us by email or other means for repair. Today, a friend received an email from the 360 website security guard about the "HTTP response splitting vulnerability" vulnerability on his website and provided a solution.

 

 

The solution is very simple, because it is a WORDPRESS program, so we go to the FUNCTIONS. Php file of the current topic and find:

 

The code is as follows: Copy code

Function redirect_comment_link (){
$ Redirect = $ _ GET ['R'];

 

Then add the following:

 

The code is as follows: Copy code

$ Redirect = trim ($ redirect );
$ Redirect = strip_tags ($ redirect, ""); // clear HTML and other code
$ Redirect = ereg_replace ("\ t", "", $ redirect); // remove the tabulation symbol
$ Redirect = ereg_replace ("\ r \ n", "", $ redirect); // remove the carriage return line break symbol
$ Redirect = ereg_replace ("\ r", "", $ redirect); // remove the carriage return
$ Redirect = ereg_replace ("\ n", "", $ redirect); // remove the line feed.
$ Redirect = ereg_replace ("", "", $ redirect); // remove spaces
$ Redirect = ereg_replace ("'", "", $ redirect); // remove single quotes

 

After the vulnerability is saved, the system generates a cache if it has a cache, and then detects the 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.