{"record":{"id":"64b016105557072a","repo":"diegosouzapw/OmniRoute","slug":"zip-entry-basename-is-data-bytelength-byte","errorCode":null,"errorMessage":"ZIP entry \"${baseName}\" is ${data.byteLength} bytes — exceeds ${maxFileSize} byte limit per file","messagePattern":"ZIP entry \"(.+?)\" is (.+?) bytes — exceeds (.+?) byte limit per file","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/oauth/utils/jsonZipExtract.ts","lineNumber":74,"sourceCode":"  const result: ExtractedZipFile[] = [];\n\n  for (const [entryName, data] of jsonEntries) {\n    const baseName = path.basename(entryName);\n\n    if (!isSafeEntryName(baseName)) {\n      throw new Error(\n        `ZIP entry \"${baseName}\" has an unsafe filename (must be a .json file without path traversal)`\n      );\n    }\n\n    if (!isSafeEntryName(entryName)) {\n      throw new Error(\n        `ZIP entry path \"${entryName}\" is unsafe (no \"..\", absolute paths, or control characters allowed)`\n      );\n    }\n\n    if (data.byteLength > maxFileSize) {\n      throw new Error(\n        `ZIP entry \"${baseName}\" is ${data.byteLength} bytes — exceeds ${maxFileSize} byte limit per file`\n      );\n    }\n\n    totalBytes += data.byteLength;\n    if (totalBytes > maxTotal) {\n      throw new Error(`ZIP archive total uncompressed size exceeds ${maxTotal} byte limit`);\n    }\n\n    const content = new TextDecoder(\"utf-8\").decode(data);\n    result.push({ name: baseName, content });\n  }\n\n  return result;\n}\n","sourceCodeStart":56,"sourceCodeEnd":90,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/oauth/utils/jsonZipExtract.ts#L56-L90","documentation":"Per-entry decompressed-size guard in extractJsonZip: a single .json entry's byteLength exceeds options.maxFileSizeBytes (default DEFAULT_MAX_FILE_SIZE). Prevents a small malicious ZIP from expanding into one huge JSON file that would exhaust memory when parsed.","triggerScenarios":"Thrown at src/lib/oauth/utils/jsonZipExtract.ts:74 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Upload an archive containing only the small auth.json you need","Raise maxFileSizeBytes in options only for trusted, large exports","Split the export into smaller archives"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}