fix(tar): classify traversal tar listing errors as blocked entries
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -116,6 +116,10 @@ async function listTarEntries(archivePath: string, cwd?: string): Promise<Archiv
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
|
if (/Member name contains '\.\.'/i.test(stderr) || /Removing leading [`']\.\.\//i.test(stderr)) {
|
||||||
|
throw new Error(`tar archive contains path traversal entries: ${stderr}`)
|
||||||
|
}
|
||||||
|
|
||||||
throw new Error(`tar entry listing failed (exit ${exitCode}): ${stderr}`)
|
throw new Error(`tar entry listing failed (exit ${exitCode}): ${stderr}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user