Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add {uuid} in path template when using local storage or S3 #2696

Merged
merged 1 commit into from
Jan 2, 2024
Merged

feat: add {uuid} in path template when using local storage or S3 #2696

merged 1 commit into from
Jan 2, 2024

Conversation

ertuil
Copy link
Contributor

@ertuil ertuil commented Jan 2, 2024

Add an addition tag {uuid} to the replacePathTemplate.

It is a workaround to leak the public links of a resource when using S3-based object storage. Currently, all resource blobs stored in S3 (R2, OSS) are set to be public. It is insecure as the resources for the private memos are also accessible on the Internet. It happens in many situations. For example, the adversary might gauss the private resources' URLs based on the public memos' URLs even using a timestamp. Also, the resource's accessibility will not be modified when the memo's accessibility is changed.

Using an additional {uuid} might reduce this risk. Actually, it is better to use a signed URL, but it might bring a large range refaction. As a result, using an additional UUID might help with little modification to the current structure. (related issues #1191 )

Meanwhile, it is also possible to avoid filename conflict using local storage.

Add an addition tag `{uuid}` to the `replacePathTemplate`.

It is a workaround to leak the public links of a resource when using S3-based object storage. Currently, all resource blobs stored in S3 (R2, OSS) are set to be public. It is insecure as the resources for the private memos are also accessible on the Internet. Using an additional {uuid} might reduce this risk.

Meanwhile, it is also possible to avoid filename conflict
@ertuil ertuil requested a review from boojack as a code owner January 2, 2024 12:16
@ertuil ertuil changed the title Add {uuid} in path template when using local storage or S3 feat: Add {uuid} in path template when using local storage or S3 Jan 2, 2024
Copy link
Collaborator

@boojack boojack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@boojack boojack changed the title feat: Add {uuid} in path template when using local storage or S3 feat: add {uuid} in path template when using local storage or S3 Jan 2, 2024
@boojack boojack merged commit 3181c07 into usememos:main Jan 2, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants