test: createZipBomb ignores its compressionRatio parameter

Offen
#2,090 0 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@Wikid82 arbeitet bereits daran.

Seit 28.11.2026.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

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.

Vorherrschende Sprache
Go
Sterne
17
Forks
2
Ø Merge
1 Std. 42 Min.
Gemergte PRs (30 T.)
173

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus Wikid82/Charon

Alle Issues in Wikid82/Charon

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.