There are loopholes and no act is terrible, shameful!

Source: Internet
Author: User
Security issues:

Whether there is permission to curd, because the parameters in the address bar, can be modified, (or parameters in the HTML page, you can use Firebug to modify the source code), so before curd to check whether the operator has this record, For example: According to the store ID and the parameters passed to query whether this record belongs to this operator, if not belong to the prompt (illegal operation, has been recorded!) To achieve the purpose of the warning)

For example:

/*      * Check if there is permission to     curd*/publicfunction Check_rbac ($theme _id) {        $model=M ();         $adm _session = es_session::get (MD5(conf ("Bi_auth_key")), 1);         $location _id=$adm _session[' supplier_locations '];         $map=array(' id ' = =$theme _id, ' location_id ' = =$location _id) ;         $result=$model->where ($map)->getfield (' id ');         if (empty($result)) {            $this->error (' Illegal operation, has been recorded! ');        }    }

The above on the introduction of a loophole is not a terrible, shameful! , including the aspects of the content, want to be interested in PHP tutorial friends helpful.

  • 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.