Skip to content

πŸ›‘οΈ Sentinel: Cap mod info.json decompression stream reads - #320

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

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

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

πŸ›‘οΈ Sentinel: [MEDIUM] Mitigate Zip Bomb / Unbounded Decompression in Mod Archives

  • 🚨 Severity: MEDIUM
  • πŸ’‘ Vulnerability: In src-tauri/src/core/services/mod_store.rs and src-tauri/src/core/services/downloader.rs, entry.read_to_string(&mut s) decompressed info.json from untrusted mod ZIP files (both scanned locally and downloaded from mirror storage) directly into memory without bounding the read stream size.
  • 🎯 Impact: A malicious or corrupted mod archive containing a compressed "Zip Bomb" info.json could cause unbounded memory allocation and an Out-Of-Memory (OOM) crash / Denial of Service.
  • πŸ”§ Fix:
    • Defined MAX_INFO_JSON_BYTES: u64 = 1_048_576 (1 MiB) in both mod_store.rs and downloader.rs.
    • Used (&mut entry).take(MAX_INFO_JSON_BYTES + 1).read_to_string(...) and returned an explicit error if the size exceeds 1 MiB.
    • Added unit tests rejects_oversized_info_json_in_zip and verify_mod_zip_sync_rejects_oversized_info_json.
    • Documented the learning in .jules/sentinel.md.
  • βœ… Verification: Verified with cargo test --manifest-path src-tauri/Cargo.toml (143 unit tests passing) and pnpm build.

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

Cap decompressed stream reads from untrusted mod archive entries to 1 MiB
to protect against decompression bombs (Zip Bombs) and unbounded memory
allocation / OOM Denial of Service.
@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