Skip to content

Commit 414033d

Browse files
committed
fix: asset path traversal on windows
1 parent 112d070 commit 414033d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

server/helpers/page.js

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ module.exports = {
3535
rawPath = rawPath.replace(unsafeCharsRegex, '')
3636
if (rawPath === '') { rawPath = 'home' }
3737

38+
rawPath = rawPath.replaceAll('\\', '').replaceAll('//', '').replaceAll(/\.\.+/ig, '')
39+
3840
// Extract Info
3941
let pathParts = _.filter(_.split(rawPath, '/'), p => {
4042
p = _.trim(p)

0 commit comments

Comments
 (0)