Skip to content

πŸ›‘οΈ Sentinel: [Security Enhancement] Add DoS protections to main block input validation#81

Closed
ManupaKDU wants to merge 1 commit into
mainfrom
sentinel-main-block-dos-protection-4977382846711229606
Closed

πŸ›‘οΈ Sentinel: [Security Enhancement] Add DoS protections to main block input validation#81
ManupaKDU wants to merge 1 commit into
mainfrom
sentinel-main-block-dos-protection-4977382846711229606

Conversation

@ManupaKDU

Copy link
Copy Markdown
Contributor

🚨 Severity: MEDIUM
πŸ’‘ Vulnerability: Missing input length limits and unhandled RecursionError handling in the __main__ block (DoS risk).
🎯 Impact: If the script is adapted to take external inputs for the target IP range, an attacker could supply a massive string or a deeply recursive object to cause CPU exhaustion or crash the application before the core validation logic is reached.
πŸ”§ Fix: Added len() > 100 string validation checks before casting to ipaddress.ip_address() and explicitly caught RecursionError alongside ValueError and TypeError in the main loop exception handler. This explicitly mirrors the DoS mitigations used elsewhere.
βœ… Verification: Ran python3 -m unittest test_testping1.py with 100% passing tests.


PR created automatically by Jules for task 4977382846711229606 started by @ManupaKDU

… input validation

This commit extends the Denial of Service (DoS) protections that already exist in the `is_reachable` function to the `__main__` entry point. It enforces input length limits on `start_ip` and `end_ip` strings to prevent CPU exhaustion and properly catches `RecursionError` in the validation block to prevent unhandled application crashes when parsing maliciously deep objects.

Co-authored-by: ManupaKDU <95234271+ManupaKDU@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.

@manupawickramasinghe manupawickramasinghe deleted the sentinel-main-block-dos-protection-4977382846711229606 branch June 7, 2026 11:28
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.

2 participants