Repository navigation
fix(vector): keep embedding inputs, zip entries and stored documents inside their folders - #3386
Merged
Merged
Conversation
…ight space Resolve filePaths with Utility.resolveContainedFile and extract zips with the limit-checked ZipUtils.unzip (new unzipNested for nested zips) instead of the hand-rolled ZipInputStream loops that trusted entry names.
…n the documents folder The source names a vector database returns can be arbitrary (CSV Source column); a name with a path no longer reaches new File(documentsDir, name).
…ach zip its own folder
…a file in the documents folder
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This was referenced Nov 24, 2026
kunal0137
marked this pull request as ready for review
November 24, 2026 21:49
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.
Summary
Snyk Code path traversal findings in the vector reactors and engines, plus the same bug class in
removeDocumentfound in review.CreateEmbeddingsFromDocumentsReactor/CreateEmbeddingsFromVectorCSVFileReactor:filePathsnow go through the existingUtility.resolveContainedFile. Before,../../xreached the vector engine, so any user with edit access to a vector DB could read arbitrary files into it.ZipUtils.unzipNested. It is built on the existing limit-checkedZipUtils.unzip, with one shared entry/byte budget and one rollback across all nesting levels (depth cap 5), and a separate folder per zip.AbstractVectorDatabaseEngine.storedDocument: a listed or removed document's local copy is used only when it is a regular file directly inside the documents folder (no.,.., separators, NUL or symlink escape).listDocumentsuses it in eight engines.removeDocumentuses it in nine engines, so a crafted name can no longer delete a parent folder.Behaviour changes
<name>-<random>folders.Testing
../entry is refused and leaves nothing behind;anext toa.zipand a file named.zipextract correctly;storedDocumentrefuses..,sub/../a, symlinks out of the folder and directories.Notes
AwsS3VectorDatabaseEnginehas the same pattern but belongs to #3016; applystoredDocumentthere after #3016 merges. Rows whose room-folder path is fixed by #3016 were left for it.Related Snyk PRs
Independent of each other unless noted; none are stacked.