How can escaping be used to prevent XSS attacks?

前端 未结 2 1419
闹比i
闹比i 2021-01-06 03:32

To prevent XSS attacks, output escaping has been enabled;

The above is from symfony,but I don\'t understand.

2条回答
  •  误落风尘
    2021-01-06 04:08

    XSS, or Cross Site Scripting is when someone else gets their javascript to be served up by your server. If, for example, you can get random javascript to get served from google.com then you can have that javascript send you everything google knows about the person to whom it's been served.

    The avoid this data that may have come from users (rather than from the server / content author) has angle-brackets and other HTML-like stuff escaped so that it won't be executed by end users.

提交回复
热议问题