Oecms storage type xss

Source: Internet
Author: User

Oecms storage type xss

The file access is not verified, and one of the parameters is escaped at the end. After reading a lot of websites using oecms, the xss is also convenient to use and directly post data, the front-end is directly triggered, and no csrf processing is performed on the backend, which increases the xss power.

There are two causes for xss:

(1) problems with file access verification under admincp

(2) There is a parameter to start filtering, and then use stripslashes to restore it.

The problem occurs in the action_saveadd () function of the admincp/frendlink. php file.

Args passed in from the _ validAdd () function

Public function action_saveadd () {$ args = $ this-> _ validAdd (); $ model = parent: model ('friendlink', 'am '); $ result = $ model-> doAdd ($ args); unset ($ model); if (true = $ result) {$ this-> log ('friendlink _ add', '', 1); XHandle: halt (" added successfully ", $ this-> cpfile. '? C = friendlink', 0);} else {$ this-> log ('friendlink _ add', '', 0); XHandle: halt ('add failed ', '', 1 );}}


The track_validadd () function filters the input parameters 'name', 'Orders ', 'flag', 'remark', and 'catid' in the getGpc function, the url is passed into the getArgs () function.

If isfliter is false, getArgs executes XFilter: stripArray (). This function restores all escape characters, resulting in an xss vulnerability.

 

public static function getArgs($value, $default=NULL, $isfliter = true) {                if (!empty($value)) {                        if (isset($_GET[$value])) $temp = trim($_GET[$value]);                        if (isset($_POST[$value])) $temp = trim($_POST[$value]);                        if ($isfliter == true) {                                $temp = XFilter::filterStr($temp);                        }                        else {                                $temp = XFilter::stripArray($temp);                        }                        if (empty($temp) && !empty($default)) {                                $temp = $default;                        }                        return trim($temp);                }                else {                        return '';                }        }
public static function stripArray(&$_data){                if (is_array($_data)){                        foreach ($_data as $_key => $_value){                                $_data[$_key] = trim(self::stripArray($_value));                        }                        return $_data;                }else{                        return stripslashes(trim($_data));                }        }

Add the frendlink directly to the post data file, and store the xss in the foreground.
 

 

Solution:

Access restrictions are imposed on the backend files and url parameters are filtered. Add the $ this-> checkAuth (') function before the function.

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.