fix: accept runtime archive root entry

This commit is contained in:
reaper
2026-08-28 01:02:07 -05:00
parent a5e942f1f9
commit ff38e91a70
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -117,8 +117,9 @@ export function validateArchiveEntries(output: string): void {
if (!entries.length || entries.length > 50000)
throw new Error('Runtime archive has an invalid file count.')
for (const entry of entries) {
if (entry === '.' || entry === './') continue
const normalized = entry.replace(/^\.\//, '')
if (!normalized || isAbsolute(normalized) || normalized.split('/').includes('..'))
if (!normalized || isAbsolute(normalized) || normalized.split(/[\\/]/).includes('..'))
throw new Error(`Unsafe runtime archive entry: ${entry}`)
}
}