Skip to content

Commit

Permalink
api: block local file paths
Browse files Browse the repository at this point in the history
  • Loading branch information
iparamonau committed Dec 9, 2024
1 parent a47ca6f commit 6a0a789
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/api/views.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ function processInitialErrors(uri, next) {
next(new utils.HttpError(400, "local domains not supported"));
return true;
}

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

export default function(app) {
Expand Down

0 comments on commit 6a0a789

Please sign in to comment.