mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-08-04 05:33:10 +00:00
fix(cloudfunc) XSS vulnerability: html in file name: allows executing malicious javascript code in the user's browser
This commit is contained in:
parent
c413d0ba6e
commit
23f4d4702c
3 changed files with 98 additions and 25 deletions
|
|
@ -10,9 +10,10 @@ const Util = require('../../common/util');
|
|||
const {
|
||||
getTitle,
|
||||
FS,
|
||||
Entity,
|
||||
} = require('../../common/cloudfunc');
|
||||
|
||||
const {encode} = require('../../common/entity');
|
||||
|
||||
const DOMTree = require('./dom-tree');
|
||||
|
||||
const DOM = Object.assign({}, DOMTree, new CmdProto());
|
||||
|
|
@ -747,7 +748,7 @@ function CmdProto() {
|
|||
const dir = PREFIX + FS + Info.dirPath;
|
||||
|
||||
link.title = name;
|
||||
link.innerHTML = Entity.encode(name);
|
||||
link.innerHTML = encode(name);
|
||||
link.href = dir + name;
|
||||
|
||||
current.setAttribute('data-name', 'js-file-' + name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue