mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-22 16:10:50 +00:00
test(plugins): lock archive inflation guard
This commit is contained in:
1 parent
ca1eb4dd41
commit
5b5f6cc79d
2 files changed
+43
-10
No files matched your search
@@ -450,6 +450,10 @@ function openZip(filePath: string): Promise<ZipFile> {
|
||||
return new Promise((resolve, reject) => {
|
||||
yauzl.open(
|
||||
filePath,
|
||||
// Security invariant: for deflated entries, validateEntrySizes inserts an
|
||||
// AssertByteCountStream that rejects an overflowing chunk before it is
|
||||
// forwarded to readEntry(). Combined with the metadata limits below,
|
||||
// captured manifest contents cannot exceed PACKAGE_LIMITS.manifestBytes.
|
||||
{ lazyEntries: true, decodeStrings: true, strictFileNames: true, validateEntrySizes: true },
|
||||
(error, zipFile) => {
|
||||
if (error || !zipFile) reject(error ?? new Error("Unable to open plugin archive"));
|
||||
|
||||
Reference in new issue
Block a user