Skip to content

πŸ›‘οΈ Sentinel: Improve robustness and validate zstd level - #7

Merged
kassoulet merged 3 commits into
mainfrom
sentinel/fix-panics-and-validate-input-3176263320086829921
May 30, 2026
Merged

πŸ›‘οΈ Sentinel: Improve robustness and validate zstd level#7
kassoulet merged 3 commits into
mainfrom
sentinel/fix-panics-and-validate-input-3176263320086829921

Conversation

@kassoulet

Copy link
Copy Markdown
Owner

πŸ›‘οΈ Sentinel: Security and Robustness Enhancement

🚨 Severity: MEDIUM
πŸ’‘ Vulnerability: Potential denial-of-service via panics in background threads and lack of CLI input validation.
🎯 Impact: Malicious or accidental out-of-range input could crash the application. Dropping the decoder prematurely would cause worker threads to panic.
πŸ”§ Fix:

  • Added clap range validation for zstd_level.
  • Implemented pre-validation of the compression level before starting the parallel pipeline.
  • Replaced .unwrap() with ? in worker threads for graceful error propagation.
    βœ… Verification: Ran cargo test and verified that unit tests and regression tests pass. Verified CLI argument validation manually with a temporary script.

PR created automatically by Jules for task 3176263320086829921 started by @kassoulet

- Add range validation (-7 to 22) for zstd compression level in CLI.
- Pre-validate zstd level in main thread to prevent panics in workers.
- Replace `unwrap()` in parallel worker threads with proper error handling
  when sending results, ensuring graceful shutdown if decoder is dropped.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

πŸ‘‹ 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.

kassoulet and others added 2 commits May 29, 2026 20:18
- Add range validation (-7 to 22) for zstd compression level in CLI.
- Pre-validate zstd level in main thread to prevent panics in workers.
- Replace `unwrap()` in parallel worker threads with proper error handling
  when sending results, ensuring graceful shutdown if decoder is dropped.
- Run `cargo fmt` to comply with CI formatting requirements.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Add range validation (-7 to 22) for zstd compression level in CLI using clap value_parser.
- Pre-validate zstd level in main thread to provide clean error messages and prevent panics in worker threads.
- Replace `unwrap()` in parallel worker threads with proper error handling (Result propagation) when sending results, ensuring graceful shutdown if the decoder is dropped early.
- Ensure all changes are properly formatted with `cargo fmt`.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@kassoulet
kassoulet merged commit d3a66d3 into main May 30, 2026
6 checks passed
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.

1 participant