You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Verify Decompressor Memory Limits and Ratio (#382)
Added integration tests to `tests/security_limit.rs` to verify that `set_max_memory_limit` and `set_limit_ratio` correctly enforce limits on real compressed data. This ensures protection against zip bombs (highly compressed files) and excessive memory allocation requests across Deflate, Zlib, and Gzip formats.
Tests include:
- `test_memory_limit_with_real_data`: Confirms decompression fails when output exceeds `max_memory_limit`.
- `test_ratio_limit_with_real_data`: Confirms decompression fails when expansion ratio exceeds `limit_ratio` (using strict limit on level 12 compressed data).
- `test_gzip_zlib_limits`: Confirms limits apply to Gzip and Zlib streams.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
0 commit comments