Skip to content

test(security): adversarial tests — sparse arrays, extreme indices, expansion bombs#936

Merged
chaliy merged 1 commit intomainfrom
claude/issue-934-adversarial-tests
Apr 2, 2026
Merged

test(security): adversarial tests — sparse arrays, extreme indices, expansion bombs#936
chaliy merged 1 commit intomainfrom
claude/issue-934-adversarial-tests

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Apr 1, 2026

Summary

  • Add 5 targeted adversarial security tests inspired by zapcode's test suite
  • Cover sparse array huge-index allocation, extreme negative indices, array entry exhaustion, brace expansion bombs, and parameter expansion replacement bombs
  • Register new threat IDs TM-DOS-059 (parameter expansion bomb) and TM-DOS-060 (sparse array attacks) in specs and docs

Test plan

  • All 5 new tests pass (cargo test --test threat_model_tests zapcode_inspired)
  • cargo fmt --check clean
  • cargo clippy --all-targets --all-features -- -D warnings clean
  • No panics, no OOB, no unbounded allocation in any test

Closes #934

…ces, expansion bombs

Add 5 targeted security tests inspired by zapcode's adversarial test suite:
- Sparse array huge index (TM-DOS-060): verify no mass allocation for arr[999999999]
- Extreme negative array index (TM-DOS-060): verify no panic/crash
- Array entry exhaustion under load (TM-DOS-060): verify max_array_entries enforcement
- Brace expansion bomb via printf (TM-DOS-041): verify {1..999999999} is capped
- Parameter expansion replacement bomb (TM-DOS-059): verify multiplicative amplification is bounded

Updates threat model (specs/006, docs/threat-model.md) with TM-DOS-059 and TM-DOS-060.

Closes #934
@chaliy chaliy force-pushed the claude/issue-934-adversarial-tests branch from 9ed189f to b394ee3 Compare April 2, 2026 04:48
@chaliy chaliy merged commit 0ef3582 into main Apr 2, 2026
18 checks passed
@chaliy chaliy deleted the claude/issue-934-adversarial-tests branch April 2, 2026 04:56
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.

test(security): Add adversarial tests for sparse arrays, extreme indices, and expansion bombs

1 participant