Skip to content

Commit

Permalink
fix(security): better path sanitize on store
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Jan 29, 2021
1 parent e81a24e commit 9403cb1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function start (server) {

function sanitizePath (path) {
// remove every ../
path = path.replace(/\.\.\//g, '')
path = path.replace(/[.]+\//g, '')

if (!path.startsWith(storeDir)) {
throw Error('Path not allowed')
Expand Down

0 comments on commit 9403cb1

Please sign in to comment.