Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.

Commit

Permalink
Don't allow downloads form non-accessible directories.
Browse files Browse the repository at this point in the history
Double-check that the user has access to both the directory and the containing
library before allowing a download a file.
  • Loading branch information
rswindell committed Aug 16, 2020
1 parent c0b6506 commit abef8a3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions web/root/api/files.ssjs
Expand Up @@ -16,6 +16,8 @@ if ((http_request.method === 'GET' || http_request.method === 'POST') &&
case 'download-file':
if (typeof http_request.query.dir !== 'undefined' &&
typeof file_area.dir[http_request.query.dir[0]] !== 'undefined' &&
file_area.dir[http_request.query.dir[0]].lib_index >= 0 &&
file_area.dir[http_request.query.dir[0]].index >= 0 &&
file_area.dir[http_request.query.dir[0]].can_download &&
typeof http_request.query.file !== 'undefined'
) {
Expand Down

0 comments on commit abef8a3

Please sign in to comment.