fix: package animated image frames into secure zip archive#14
Open
devopenstuds wants to merge 1 commit intoswe-productivity:mainfrom
Open
fix: package animated image frames into secure zip archive#14devopenstuds wants to merge 1 commit intoswe-productivity:mainfrom
devopenstuds wants to merge 1 commit intoswe-productivity:mainfrom
Conversation
C4illin
reviewed
Mar 24, 2026
| const extension = lastDotIndex > 0 ? newFileName.substring(lastDotIndex + 1) : ""; | ||
|
|
||
| // Sanitize: strip path separators then apply sanitize-filename to prevent path traversal | ||
| const safeBaseFileName = sanitize(baseFileName.replace(/[/\\]/g, "")); |
Collaborator
There was a problem hiding this comment.
sanitize already removes / and \
C4illin
reviewed
Mar 24, 2026
| ); | ||
| } | ||
|
|
||
| const zip = new AdmZip(); |
Collaborator
There was a problem hiding this comment.
What do you think about using tar instead like src/pages/download.tsx
C4illin
reviewed
Mar 24, 2026
Collaborator
C4illin
left a comment
There was a problem hiding this comment.
Seems to work fine! Left some comments
Instead of zipping the images, maybe it would make more sense to simulate normal files so the user doesn't have to unpack a zip or tar. Generally image data shouldn't be so compressable and they can still download a tar in the end in the download dialog.
I think this can be done by adding one entry for each file to the db.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4