Commit 37f871bb authored by Medicean's avatar Medicean

(Security:toastr) Fix #147

parent d8471a1f
...@@ -2,7 +2,13 @@ ...@@ -2,7 +2,13 @@
> 有空会补补BUG、添添新功能。 > 有空会补补BUG、添添新功能。
> 同时也欢迎大家的参与!感谢各位朋友的支持! .TAT. > 同时也欢迎大家的参与!感谢各位朋友的支持! .TAT.
## `v(2.0.8)` ## `v(2.0.7.1)`
### 安全更新 (重要)
* Fix toastr 输出时未过滤导致的 xss 漏洞, 由于在 webview 中开启了 nodejs 功能, 可借此引起 RCE #147 (thx @ev0A)
> 为了防止插件中 toastr 出现类似问题, 修改了 toastr 可以输出 html 的特点,以后均不支持输出 html
### 其它 ### 其它
......
{ {
"name": "antsword", "name": "antsword",
"version": "2.0.7", "version": "2.0.7.1",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
......
{ {
"name": "antsword", "name": "antsword",
"version": "2.0.7", "version": "2.0.7.1",
"description": "中国蚁剑是一款跨平台的开源网站管理工具", "description": "中国蚁剑是一款跨平台的开源网站管理工具",
"main": "app.js", "main": "app.js",
"dependencies": { "dependencies": {
......
...@@ -234,12 +234,20 @@ ...@@ -234,12 +234,20 @@
} }
if (map.title) { if (map.title) {
$titleElement.append(map.title).addClass(options.titleClass); $titleElement.append(String(map.title)
.replace(/&/g, "&")
.replace(/>/g, ">")
.replace(/</g, "&lt;")
.replace(/"/g, "&quot;")).addClass(options.titleClass);
$toastElement.append($titleElement); $toastElement.append($titleElement);
} }
if (map.message) { if (map.message) {
$messageElement.append(map.message).addClass(options.messageClass); $messageElement.append(String(map.message)
.replace(/&/g, "&amp;")
.replace(/>/g, "&gt;")
.replace(/</g, "&lt;")
.replace(/"/g, "&quot;")).addClass(options.messageClass);
$toastElement.append($messageElement); $toastElement.append($messageElement);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment