test: createZipBomb ignores its compressionRatio parameter

Đang mở
#2,090 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@Wikid82 đang làm issue này rồi.

Từ ngày 28/11/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

testing

What: createZipBomb(outputPath, compressionRatio = 150) in tests/utils/archive-helpers.ts never uses compressionRatio. It always writes ~10MB of zeros, which gives a ratio of about 1000x whatever the caller passes.

Severity: low (test helper; misleading signature, no product impact).

Evidence: Found while migrating the helpers to node-tar v8. A level-9 archive measured about 1017x regardless of the argument.

Suggested approach: either size the payload from compressionRatio or remove the parameter and update callers.

Note: node-tar v8 readers enforce maxDecompressionRatio (default 1000). Any future test that reads the zip bomb back through listTarGzEntries/readTarGzEntry will throw TAR_ABORT unless it raises that limit.

Ngôn ngữ chính
Go
Star
17
Fork
2
Merge trung bình
1 giờ 42 phút
Pull request đã merge (30 ngày)
173

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Wikid82/Charon

Tất cả issue của Wikid82/Charon

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.