{"record":{"id":"b5b9a66b84d1d18d","repo":"paperclipai/paperclip","slug":"unsupported-zip-archive-a-compressed-entry-expand","errorCode":null,"errorMessage":"Unsupported zip archive: a compressed entry expands beyond the ${maxEntryDecompressedBytes}-byte per-entry limit.","messagePattern":"Unsupported zip archive: a compressed entry expands beyond the (.+?)-byte per-entry limit\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/shared/src/portability-zip.ts","lineNumber":200,"sourceCode":"function inflateZipEntry(compressionMethod: number, bytes: Uint8Array, maxEntryDecompressedBytes: number) {\n  if (compressionMethod === 0) {\n    if (bytes.length > maxEntryDecompressedBytes) {\n      throw new Error(\n        `Unsupported zip archive: a stored entry exceeds the ${maxEntryDecompressedBytes}-byte per-entry limit.`,\n      );\n    }\n    return bytes;\n  }\n  if (compressionMethod !== 8) {\n    throw new Error(\"Unsupported zip archive: only STORE and DEFLATE entries are supported.\");\n  }\n  try {\n    // maxOutputLength makes zlib throw (ERR_BUFFER_TOO_LARGE) before it allocates\n    // past the per-entry ceiling, so a bomb entry never materializes in memory.\n    return new Uint8Array(inflateRawSync(bytes, { maxOutputLength: maxEntryDecompressedBytes }));\n  } catch (error) {\n    if ((error as NodeJS.ErrnoException | undefined)?.code === \"ERR_BUFFER_TOO_LARGE\") {\n      throw new Error(\n        `Unsupported zip archive: a compressed entry expands beyond the ${maxEntryDecompressedBytes}-byte per-entry limit.`,\n      );\n    }\n    throw error;\n  }\n}\n\nexport async function readZipArchive(\n  source: ArrayBuffer | Uint8Array,\n  limits: ReadZipArchiveLimits = DEFAULT_ZIP_LIMITS,\n): Promise<{\n  rootPath: string | null;\n  files: Record<string, CompanyPortabilityFileEntry>;\n}> {\n  const { maxEntryDecompressedBytes, maxTotalDecompressedBytes } = limits;\n  const bytes = source instanceof Uint8Array ? source : new Uint8Array(source);\n  const entries: Array<{ path: string; body: CompanyPortabilityFileEntry }> = [];\n  let offset = 0;","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/packages/shared/src/portability-zip.ts#L182-L218","documentation":"Error \"Unsupported zip archive: a compressed entry expands beyond the ${maxEntryDecompressedBytes}-byte per-entry limit.\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at packages/shared/src/portability-zip.ts:200 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Split the archive so decompressed entries stay under the per-entry limit."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}