To develop a simple PHP framework, what are the security issues to be aware of?

Source: Internet
Author: User
Tags php framework
Self-think, do a simple PHP MVC framework, with URL routing function to match the name of the controller and method in the URL, if method_exists then new controller again with CALL_USER_FUNC_ Array to execute the method, or introduce the error controller, each controller can require introduced model, and then require introduced TPL, this is I do a simple PHP framework of the idea, What safety issues should be noticed in this area?

Reply content:

Self-think, do a simple PHP MVC framework, with URL routing function to match the name of the controller and method in the URL, if method_exists then new controller again with CALL_USER_FUNC_ Array to execute the method, or introduce the error controller, each controller can require introduced model, and then require introduced TPL, this is I do a simple PHP framework of the idea, What safety issues should be noticed in this area?

    • Path problem, cannot apply external file via URL call such as/etc/passwd

    • Data filtering, 永远不要信任用户的任何输入 . All input data is htmlspecialchars filtered back into storage.

    • Database, using PDO instead mysql_xxxx , using parameter bindings to process external data (extensions can be used if the database uses only MySQL mysqli )

About call_user_func_array the security issues that preceded Drupal in the tussle.

Http://blog.knownsec.com/2014/10/drupal__callback_nightmare/

requireA file containment vulnerability could be generated.

Http://www.neatstudio.com/show-1123-1.shtml

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