Commit 596e261a authored by antoor's avatar antoor

修复虚拟终端中过滤不严引起的XSS安全问题

parent d70ddc13
......@@ -4,6 +4,9 @@
## 2016/03
### /15
1. 修复了部分XSS遗留问题(主要在语言模板以及文件管理上还有虚拟终端等,其他地方可能还存在
### /14
1. 修复文件管理中过滤不当引发的xss安全问题
2. 增加窗口调整大小刷新UI之前弹框提醒用户选择是否刷新
......
......@@ -136,7 +136,7 @@ class Terminal {
let cache_tag = 'command-' + new Buffer(this.path + cmd).toString('base64');
let cache_cmd;
if (cache_cmd = this.cache.get(cache_tag)) {
term.echo(cache_cmd);
term.echo(antSword.noxss(cache_cmd));
return term.resume();
};
this.core.command.exec({
......@@ -165,7 +165,7 @@ class Terminal {
});
// output = output.replace(/\n$/, '').replace(/^\n/, '').replace(/^\r/, '').replace(/\r$/, '').;
if (output.length > 0) {
term.echo(output);
term.echo(antSword.noxss(output));
// 保存最大100kb数据
if (output.length < (1024 * 1024)) {
this.cache.set(cache_tag, output);
......@@ -198,7 +198,8 @@ class Terminal {
// 生成路径提示
parsePrompt(user) {
return this.isWin ? '[[b;white;]' + this.path.replace(/\//g, '\\') + '> ]' : (user ? ('([[b;#E80000;]' + user + ']:[[;#0F93D2;]') : '[[;0F93D2;]') + this.path + ']) $ ';
let ret = this.isWin ? '[[b;white;]' + this.path.replace(/\//g, '\\') + '> ]' : (user ? ('([[b;#E80000;]' + user + ']:[[;#0F93D2;]') : '[[;0F93D2;]') + this.path + ']) $ ';
return antSword.noxss(ret);
}
}
......
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