Solving the problems caused by XSS script injection with jquery encoder

Source: Internet
Author: User

Symptom: The front end receives a background data (which contains HTML) tags, automatically translates into HTML page elements, and automatically executes the script, causing the front page blocking

The received background data is a large number of duplicates of the following code

< Script > alert ("1"); </ Script >< Button >I am but</button>

I was aware of the XSS attack at this point.

But what is XSS attack?

Degree Niang explanation is a cross-site scripting attack, I now understand is to intercept background requests, return a page can execute a malicious script, so that the Web application of the interface paralysis, there may be more harm, after understanding in addition (6.14).

So how do I fix a page that always executes the alert in the script?
I found out later that jquery encoder provided some sort of API to solve a similar problem, so it's easy to solve the problem and become the Learning API, which is my favorite part of solving the problem.

Solving the problems caused by XSS script injection with jquery encoder

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.