diegosouzapw/OmniRoute · error

ZIP entry " " is bytes — exceeds byte limit per file

Error message

ZIP entry "${baseName}" is ${data.byteLength} bytes — exceeds ${maxFileSize} byte limit per file

What it means

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.

Solutions

  1. Upload an archive containing only the small auth.json you need
  2. Raise maxFileSizeBytes in options only for trusted, large exports
  3. Split the export into smaller archives
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/lib/oauth/utils/jsonZipExtract.ts:74 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/64b016105557072a. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/oauth/utils/jsonZipExtract.ts:74

  const result: ExtractedZipFile[] = [];

  for (const [entryName, data] of jsonEntries) {
    const baseName = path.basename(entryName);

    if (!isSafeEntryName(baseName)) {
      throw new Error(
        `ZIP entry "${baseName}" has an unsafe filename (must be a .json file without path traversal)`
      );
    }

    if (!isSafeEntryName(entryName)) {
      throw new Error(
        `ZIP entry path "${entryName}" is unsafe (no "..", absolute paths, or control characters allowed)`
      );
    }

    if (data.byteLength > maxFileSize) {
      throw new Error(
        `ZIP entry "${baseName}" is ${data.byteLength} bytes — exceeds ${maxFileSize} byte limit per file`
      );
    }

    totalBytes += data.byteLength;
    if (totalBytes > maxTotal) {
      throw new Error(`ZIP archive total uncompressed size exceeds ${maxTotal} byte limit`);
    }

    const content = new TextDecoder("utf-8").decode(data);
    result.push({ name: baseName, content });
  }

  return result;
}

View on GitHub (pinned to a179ffed5b)