Network security-is PHP only filtering user input via filter, is it safe enough?

Source: Internet
Author: User
The application scenario is that the user can enter any text, but cannot enter code like HTML

User input can be filtered through filter_sanitize_string in PHP

is the filtered content safe enough to be used for other uses such as XSS filtering?

Reply content:

The application scenario is that the user can enter any text, but cannot enter code like HTML

User input can be filtered through filter_sanitize_string in PHP

is the filtered content safe enough to be used for other uses such as XSS filtering?

The title mentions safe enough ... The key is to see how you understand this is enough ...

For XSS ... The full name of XSS is Cross-site Scripting ... Key points in Scripting ...

If you use the ... FILTER_SANITIZE_STRING There is definitely no risk of being XSS ...

But that doesn't mean it's completely safe anywhere ... Other risks still exist ...

For example, this content can not be directly written into the SQL statement before processing.

And also depends on how you put the user input content display ...

If the user enters content that may legitimately appear in the script tag ... Additional processing must also be done ...

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