From a93efde1ae46c96c0806e6c7ed0d10253c048e77 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Tue, 19 Jul 2016 11:58:10 +0100 Subject: [PATCH] add file path check on element names --- .../app/coffee/Features/Project/ProjectEntityHandler.coffee | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/web/app/coffee/Features/Project/ProjectEntityHandler.coffee b/services/web/app/coffee/Features/Project/ProjectEntityHandler.coffee index 946a57d527..c68f732f16 100644 --- a/services/web/app/coffee/Features/Project/ProjectEntityHandler.coffee +++ b/services/web/app/coffee/Features/Project/ProjectEntityHandler.coffee @@ -512,6 +512,11 @@ module.exports = ProjectEntityHandler = return callback(e) type = sanitizeTypeOfElement type + if path.resolve("/", element.name) isnt "/#{element.name}" or element.name.match("/") + e = new Error("invalid element name") + logger.err project_id:project._id, folder_id:folder_id, element:element, type:type, "failed trying to insert element as name was invalid" + return callback(e) + if !folder_id? folder_id = project.rootFolder[0]._id ProjectEntityHandler._countElements project, (err, count)->