PHP Security Programming: Session Data Injection _php tutorial

Source: Internet
Author: User

PHP Security Programming: Session Data injection


A similar problem with a session exposure is conversation injection. This type of attack is based on your Web server's write permissions in addition to the Read permission to the session store directory. Therefore, there is a possibility to write a script that allows other users to add, edit, or delete sessions. The following example shows an HTML form that allows users to easily edit existing session data:

 
  

The script inject.php executes the modifications specified by the form:

 
  $sess _data) {  $_session = $sess _data;  $sess _data = Session_encode;  File_put_contents ($path/$sess _name, $sess _data);} $_session = Array ();? >

This type of attack is very dangerous. Not only can an attacker edit your user's data, but it can also edit his or her own session data. It is more powerful than session hijacking because attackers can select all session data for modification, which makes it possible to bypass access restrictions and other security measures.

The best solution for this problem is to keep session data in the database. See the section on the front of the topic.

Extended Reading


http://www.bkjia.com/PHPjc/876631.html www.bkjia.com true http://www.bkjia.com/PHPjc/876631.html techarticle PHP Security Programming: Session data injection A similar problem is exposed to session injection. This type of attack is based on your Web server in addition to the session storage directory has Read permissions, there are ...

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