Skip to content

Commit

Permalink
api: block more of the local file paths
Browse files Browse the repository at this point in the history
  • Loading branch information
iparamonau committed Dec 9, 2024
1 parent 6a0a789 commit 3287b6f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/api/views.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function processInitialErrors(uri, next) {
return true;
}

if (/^(https?:\/\/)?\./i.test(uri)) {
if (/^(https?:\/\/)?(\.|\/|~)/i.test(uri)) {
next(new utils.HttpError(400, "file paths are not accepted"));
return true;
}
Expand Down

0 comments on commit 3287b6f

Please sign in to comment.