Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.
TypeScript cloud-alternativecollaborationcollaborative-editingdropboxfile-serverfile-sharingfile-storagefile-syncfull-text-searchhomelabnextcloudon-premiseopen-sourceprivacy-firstprivate-cloudrealtimesecureself-hostedstorage-serverwebdav
fix(backend:files): throw consistent error for unsafe filenames in unzip tests
johavena0652de9b30d
diff --git a/backend/src/applications/files/utils/unzip-file.spec.ts b/backend/src/applications/files/utils/unzip-file.spec.tsindex 65aae00b..ef302743 100644--- a/backend/src/applications/files/utils/unzip-file.spec.ts+++ b/backend/src/applications/files/utils/unzip-file.spec.ts@@ -57,7 +57,7 @@ describe(extractZip.name, () => {await writeFile(archivePath, createZip('..\\zip-slip-proof.txt'))- await expect(extractZip(archivePath, outputDir)).rejects.toThrow('invalid relative path: ../zip-slip-proof.txt')+ await expect(extractZip(archivePath, outputDir)).rejects.toThrow(ERR_UNSAFE_FILENAME)await expect(access(escapedPath)).rejects.toMatchObject({ code: 'ENOENT' })await writeFile(archivePath, createZip('link', Buffer.from('../../outside'), 0o120777))