Skip to content

πŸ›‘οΈ Sentinel: [MEDIUM] Prevent Zip Bomb / OOM DoS in archive entry inspection - #310

Open
google-labs-jules[bot] wants to merge 1 commit into
mainfrom
sentinel/cap-zip-decompression-17173700962531420412
Open

google-labs-jules[bot] wants to merge 1 commit into
mainfrom
sentinel/cap-zip-decompression-17173700962531420412

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

🚨 Severity: MEDIUM
πŸ’‘ Vulnerability: Untrusted mod zips scanned or downloaded into the application had their info.json entries decompressed into memory using Read::read_to_string without an upper bound on decompressed byte length. A malicious or malformed archive entry (zip bomb) could expand indefinitely, exhausting system memory and causing an Out-Of-Memory (OOM) denial-of-service crash.
🎯 Impact: Denial of Service (application crash / system memory exhaustion) upon downloading or scanning a crafted mod zip bomb.
πŸ”§ Fix: Added read_entry_to_string_capped helper in mod_store.rs that caps stream reads at 1 MiB (MAX_INFO_JSON_BYTES + 1) via .take(), rejecting oversized entries cleanly with an error. Applied this to both mod_store::read_info_json and downloader::verify_mod_zip_sync.
βœ… Verification: Added unit tests verifying rejection of entries exceeding 1 MiB in both mod_store and downloader, verified all 143 backend tests pass (cargo test --manifest-path src-tauri/Cargo.toml), and confirmed pnpm build succeeds.


PR created automatically by Jules for task 17173700962531420412 started by @TheDragonSoft

Unbounded read_to_string on untrusted archive entries could allow
crafted zip files to exhaust system memory and cause an OOM crash.
Cap reads at 1 MiB using take() and reject oversized entries cleanly.
@google-labs-jules

Copy link
Copy Markdown
Contributor Author

πŸ‘‹ 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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.

0 participants