仓库名称: horilla-opensource/horilla-crm 提交ID: fc5c8e5 提交信息: [FIX] STATIC: Fixed xss vulnerability issue in summer note 提交人: horilla-opensource 提交日期: Last month 关键信息: - 修复了夏天笔记中的XSS漏洞。 - 修改了5个文件, 共改动了+108行, -2行。 - 引入了DOMPurify库以对HTML进行净化处理,防止XSS攻击。 - 代码净化配置: - 允许的标签 (ALLOWED_TAGS) 包括 p, br, b, i, u, strong, em, ul, ol 等。 - 允许的属性 (ALLOWED_ATTR) 包括 href, title, target, src, alt 等。 - 禁止的标签 (FORBID_TAGS) 包括 script, iframe, object, embed, applet, link, form, input, button, svg, math 等。 - 禁止的属性 (FORBID_ATTR) 包括 onerror, onload, onclick, onmouseover, onfocus 等。 - 增加了对代码区域内容的净化处理。 - 拦截了Code-view按钮点击事件和快捷键Ctrl+Shift+C, Cmd+Shift+C, 在Summernote处理之前净化代码区域内容。 - 修正了jQuery的html()方法, 对.note-editable元素的内容进行净化处理。 - 在Summernote通过'code'命令设置内容时进行拦截和净化。 - 在粘贴时进行净化处理。 受影响文件: - static/assets/img/not-found-chart.svg - static/assets/img/not-found-list.svg - static/assets/js/global.js - static/assets/js/summernote/purify.min.js - templates/index.html