Try to fix some security issues. Part 2.

Thanks to responsible security disclosure contributors and xet7 !
This commit is contained in:
Lauri Ojansivu 2023-02-20 16:48:02 -05:00
parent e34cfad06b
commit 382168a5b4
9 changed files with 2198 additions and 3712 deletions

View file

@ -151,6 +151,7 @@ if (Meteor.isServer) {
check(fileObjId, String);
check(newName, String);
// If new name is same as sanitized name, does not have XSS, allow rename file
// Using isomorphic-dompurify that is isometric so it works also serverside.
if (newName === DOMPurify.sanitize(newName)) {
const fileObj = Attachments.findOne({_id: fileObjId});
rename(fileObj, newName, fileStoreStrategyFactory);