ban / as a path

This commit is contained in:
Robert Brignull
2020-07-10 15:02:18 +01:00
parent 1a4c658bbf
commit 189b6ef4bf
3 changed files with 15 additions and 1 deletions

View File

@@ -142,6 +142,15 @@ export function validateAndSanitisePath(
path = path.substring(0, path.length - 2);
}
// An empty path is not allowed as it's meaningless
if (path === '') {
throw new Error(getConfigFilePropertyError(
configFile,
propertyName,
'"' + originalPath + '" is not an invalid path. ' +
'It is not necessary to include it, and it is not allowed to exclude it.'));
}
// Check for illegal uses of **
if (path.match(pathStarsRegex)) {
throw new Error(getConfigFilePropertyError(