Compare commits

...
3 Commits
Author SHA1 Message Date
Maksim Eltyshev ac1df5201d fix: Fix path traversal vulnerability 2022-08-04 00:37:30 +02:00
Maksim Eltyshev fbe24c0fc0 chore: Update version 2022-08-03 13:28:41 +02:00
Maksim Eltyshev 79daed6afa docs: Add security policy
Closes #276
2022-08-03 16:15:40 +05:00
4 changed files with 17 additions and 8 deletions
+13
View File
@@ -0,0 +1,13 @@
# Security Policy
## Supported Versions
Most recent release.
## Reporting a Vulnerability
Please report any security issues you discovered to meltyshev@gmail.com. If the issue is confirmed, we will release a patch as soon as possible depending on complexity.
**Do NOT create public issues on GitHub for security vulnerabilities.**
Thank you for your contribution!
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "planka", "name": "planka",
"version": "1.5.0", "version": "1.5.1",
"private": true, "private": true,
"homepage": "https://plankanban.github.io/planka", "homepage": "https://plankanban.github.io/planka",
"repository": { "repository": {
@@ -14,10 +14,6 @@ module.exports = {
regex: /^[0-9]+$/, regex: /^[0-9]+$/,
required: true, required: true,
}, },
filename: {
type: 'string',
required: true,
},
}, },
exits: { exits: {
@@ -54,14 +50,14 @@ module.exports = {
sails.config.custom.attachmentsPath, sails.config.custom.attachmentsPath,
attachment.dirname, attachment.dirname,
'thumbnails', 'thumbnails',
inputs.filename, 'cover-256.jpg',
); );
if (!fs.existsSync(filePath)) { if (!fs.existsSync(filePath)) {
throw Errors.ATTACHMENT_NOT_FOUND; throw Errors.ATTACHMENT_NOT_FOUND;
} }
this.res.type(attachment.filename); this.res.type('image/jpeg');
this.res.set('Cache-Control', 'private, max-age=900'); // TODO: move to config this.res.set('Cache-Control', 'private, max-age=900'); // TODO: move to config
return exits.success(fs.createReadStream(filePath)); return exits.success(fs.createReadStream(filePath));
+1 -1
View File
@@ -80,7 +80,7 @@ module.exports.routes = {
skipAssets: false, skipAssets: false,
}, },
'GET /attachments/:id/download/thumbnails/:filename': { 'GET /attachments/:id/download/thumbnails/cover-256.jpg': {
action: 'attachments/download-thumbnail', action: 'attachments/download-thumbnail',
skipAssets: false, skipAssets: false,
}, },