duan0818 2013-12-22 08:39
浏览 109
已采纳

CKEditor XSS干净

I've web-project, where I allow users to use CKEditor, and thats why I need to secure me from any XSS. How do I minimise any risks of being "attacked" with XSS?

I don't know if this will be enough, I guess no:

strip_tage(Input::get('text'), '<p><a><h1><h2>');

So question is how to be XSS Clean from CKEditor on server-side and what I need to do on CKEditor side, which plugins to remove (as I removed source code plugin, maybe I also should remove styles plugin??)???

  • 写回答

1条回答 默认 最新

  • dsyua2828 2013-12-22 12:19
    关注

    Use HTML Purifier.

    It was created specifically for sanitizing HTML and fixing invalid markup such as incorrectly nested tags or unescaped special characters.

    It doesn't matter what plugins you remove from CKEditor, a malicious user can completely bypass CKEditor and submit any string they want.

    strip_tags with $allowable_tags doesn't offer good enough protection from XSS, because scripts and styles can be embedded in tag attributes such as href, onmouseover, onerror, etc. It's also possible to reuse some of the application styles and scripts by adding id and class attributes.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效