Repository navigation
π‘οΈ Sentinel: cap decompressed archive entry reads to prevent zip bomb DoS - #317
google-labs-jules[bot] wants to merge 1 commit into
Conversation
Unbounded decompression of `info.json` from untrusted mod ZIP archives via `read_to_string()` exposed the application to potential zip bomb / decompression bomb attacks causing Out-Of-Memory (OOM) Denial of Service. This patch introduces `read_entry_to_string` with a 2 MB cap (`MAX_INFO_JSON_BYTES`), bounding decompression stream reads via `.take()`, and adds unit tests to verify oversized metadata entries are safely rejected.
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
π‘οΈ Sentinel Security Report
info.jsonarchive entries usingread_to_stringdirectly onzip::read::ZipFileinmod_store.rsanddownloader.rs.MAX_INFO_JSON_BYTES(2 MB) and capped stream decompression reads using.take(MAX_INFO_JSON_BYTES + 1)inread_entry_to_string. Any archive entry exceeding 2 MB is immediately and safely rejected with anAppError::Parsewithout consuming additional memory.mod_store.rs(test_malformed_info_json_variants) anddownloader.rs(verify_mod_zip_sync_rejects_oversized_info_json) verifying rejection of oversized entries; ran full test suite (cargo test --manifest-path src-tauri/Cargo.toml) and frontend typecheck (pnpm build).PR created automatically by Jules for task 3330383156431349778 started by @TheDragonSoft