You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, firstly, I'd like to say I'm absolutely loving this so far. Has been exactly what I've been trying to find for a while! Looking forward to what has to come 💪.
Bug
Once a user has uploaded an attachment (such as their profile avatar) it is available at https://example.com/api/attachments/img/avatar/<image-id>.<ext>, or an image within a document at https://example.com/api/files/<id>/<image-id>.<ext>.
These endpoints are accessible by non-authenticated users and require no authentication.
Proposed Solution
These endpoints should only be allowed if the user is authenticated and currently logged in. Or at minimum, a configuration parameter to set the /api/attachments endpoint to require authentication.
Avatar images will be visible to anyone with the URL. I want to avoid making too many permissions checks.
File attachments will be visible to those who have permission to the pages they belong to. I have deviated a bit for now because my initial checks required too many DB calls to get the right permissions than I would like. I will revisit this sometime soon.
Activity
Philipinho commentedon Jul 1, 2024
In my original design,
docmost/apps/server/src/core/attachment/attachment.controller.ts
Lines 132 to 135 in d1ae117
I appreciate your input, and I would love to hear what others think too.
archef2000 commentedon Jul 1, 2024
Files should be private. imo
denysvitali commentedon Jul 2, 2024
Either private, or use something similar to presigned URLs
Philipinho commentedon Jul 5, 2024
Attachments added to pages will inherit the space/page permissions.
Fixed in v0.2.3, please upgrade to the latest version of Docmost.
Merge pull request docmost#35 from fuscodev/forkmost/breadcrumb-mentions
fix(page-templates): never strand a page-embed id in-flight (docmost#35)