We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 33c310e commit d619ab8Copy full SHA for d619ab8
src/archiveDirectory.ts
@@ -100,7 +100,7 @@ async function tarDirectory(
100
gzip: true,
101
file: tempFile.name,
102
cwd: sourceDirectory,
103
- follow: true,
+ follow: false,
104
noDirRecurse: true,
105
portable: true,
106
},
@@ -141,7 +141,14 @@ async function zipDirectory(
141
}
142
throw err;
143
144
- for (const file of files) {
+ // For security, filter out all symlinks
145
+ const realFiles = await Promise.all(
146
+ files.filter(async (f) => {
147
+ const stats = await fs.promises.lstat(f.name);
148
+ return !stats.isSymbolicLink();
149
+ }),
150
+ );
151
+ for (const file of realFiles) {
152
const name = path.relative(sourceDirectory, file.name);
153
allFiles.push(name);
154
archive.file(file.name, {
0 commit comments