[請益] CKEditor XSS 問題

作者: chan15 (ChaN)   2015-09-07 12:20:18
今天內文部分提供了 CKEditor,並且開方編輯 source 的權限
所以 user 是可以寫像 <script>alert(1);</script> 的語法
前台為了呈現其他編輯器的效果是不能用 htmlspecialchars 過濾的
該如何呈現 HTML 又過濾 xss 呢
作者: shadowjohn (轉角遇到愛)   2015-09-07 13:06:00
以前是用bbcode之類的限制,script、event都拿掉http://3wa.tw/url.php?id=309 ckeditor有內鍵的
作者: gname ((′口‵)↗︴<><...<><)   2015-09-07 13:13:00
最簡單的方式就是自己寫 filter 啊..
作者: tka (tka)   2015-09-07 23:19:00
http://htmlpurifier.org/ 不曉得合不合你用
作者: poiuy999 (Nines)   2015-09-07 23:43:00
addslashes($_POST)stripcslashes($record)

Links booklink

Contact Us: admin [ a t ] ucptt.com