fix: asset path traversal on windows

pull/4789/head
NGPixel 3 years ago
parent 112d070730
commit 414033de9d
No known key found for this signature in database
GPG Key ID: 8FDA2F1757F60D63

@ -35,6 +35,8 @@ module.exports = {
rawPath = rawPath.replace(unsafeCharsRegex, '')
if (rawPath === '') { rawPath = 'home' }
rawPath = rawPath.replaceAll('\\', '').replaceAll('//', '').replaceAll(/\.\.+/ig, '')
// Extract Info
let pathParts = _.filter(_.split(rawPath, '/'), p => {
p = _.trim(p)

Loading…
Cancel
Save