Skip to content

fix: harden archive extraction against DoS and entry injection#118

Merged
jdalton merged 2 commits intomainfrom
fix/archive-extraction-hardening
Mar 28, 2026
Merged

fix: harden archive extraction against DoS and entry injection#118
jdalton merged 2 commits intomainfrom
fix/archive-extraction-hardening

Conversation

@jdalton
Copy link
Copy Markdown
Collaborator

@jdalton jdalton commented Mar 28, 2026

Summary

  • Add maxEntries option (default: 100,000) to all extraction functions to prevent inode exhaustion DoS attacks
  • Add null byte detection in archive entry names across tar, tar.gz, and zip extractors (defense in depth against entry injection)
  • New DEFAULT_MAX_ENTRIES constant and maxEntries field on ExtractOptions interface

Test plan

  • All 38 existing archive tests pass (test/unit/archives.test.mts)
  • oxlint and oxfmt pass on changed file
  • Build succeeds with all validations

@jdalton jdalton merged commit ab2e353 into main Mar 28, 2026
11 checks passed
@jdalton jdalton deleted the fix/archive-extraction-hardening branch March 28, 2026 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant