Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
antSword
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HuangJunbo
antSword
Commits
596e261a
Commit
596e261a
authored
Mar 16, 2016
by
antoor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复虚拟终端中过滤不严引起的XSS安全问题
parent
d70ddc13
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
CHANGELOG.md
CHANGELOG.md
+3
-0
index.jsx
source/modules/terminal/index.jsx
+4
-3
No files found.
CHANGELOG.md
View file @
596e261a
...
...
@@ -4,6 +4,9 @@
## 2016/03
### /15
1.
修复了部分XSS遗留问题(主要在语言模板以及文件管理上还有虚拟终端等,其他地方可能还存在
### /14
1.
修复文件管理中过滤不当引发的xss安全问题
2.
增加窗口调整大小刷新UI之前弹框提醒用户选择是否刷新
...
...
source/modules/terminal/index.jsx
View file @
596e261a
...
...
@@ -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);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment