How and where can XSS protection be applied in Laravel?

前端 未结 6 1962
孤城傲影
孤城傲影 2020-12-14 19:08

I wonder how (if anyhow) is XSS protection provided in Laravel. I couldn\'t find anything about it in the documentation.

Problem

I am using

6条回答
  •  半阙折子戏
    2020-12-14 19:58

    I examined the Laravel's protection {{{...}}} against xss attack. It just uses the htmlentities() function in the way like this: htmlentities('javascript:alert("xss")', ENT_QUOTES, 'UTF-8', false); This protects you against xss only if you use it properly means dont use it in certain HTML tags because it will result in XSS attack possibility. For example:

    $a = htmlentities('javascript:alert("xss")', ENT_QUOTES, 'UTF-8', false); 
    echo 'link';
    

    In this case, it is vulnerable to xss.

提交回复
热议问题