PHP Markdown XSS Sanitizer

前端 未结 4 705
情话喂你
情话喂你 2020-12-07 02:42

I\'m looking for a simple PHP library that helps filter XSS vulnerabilities in PHP Markdown output. I.E. PHP Markdown will parse things such as:

[XSS Vulnera         


        
4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-07 03:21

    I had a suggestion, and I asked on SO to find out if it would work but unfortunately, it was closed and marked as a duplicate to this question.

    My suggestion is modifying markdown's code and allowing only links and image sources to start with http://, https:// or ftp:// which covers all the common protocols required. If the link doesn't start with one of these, then it should be left unchanged in the output.

提交回复
热议问题