mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-11-20 06:36:52 +00:00
Properly escape the foldername to avoid XSS issues
This commit is contained in:
1 parent
a2a89e8720
commit
25dbd4849d
2 files changed
+7
-5
No files matched your search
@@ -192,7 +192,11 @@ function addFolderBranchToTree(tree, user, folder, nodeId, subId, isLast) {
|
||||
else
|
||||
icon += 'calendar-folder-16x16.png';
|
||||
var folderId = user + ":" + folderInfos[1].substr(1);
|
||||
var name = folderInfos[0]; // name has the format "Folername (Firstname Lastname <email>)"
|
||||
|
||||
// name has the format "Foldername (Firstname Lastname <email>)"
|
||||
// We sanitize the value to avoid XSS issues
|
||||
var name = folderInfos[0].escapeHTML();
|
||||
|
||||
var pos = name.lastIndexOf(' (');
|
||||
if (pos > -1)
|
||||
name = name.substring(0, pos); // strip the part with fullname and email
|
||||
|
||||
Reference in new issue
Block a user