Skip to content

πŸ›‘οΈ Sentinel: [CRITICAL/HIGH] Fix SSRF vulnerability in network scanner#21

Merged
manupawickramasinghe merged 1 commit intomainfrom
sentinel-ssrf-prevention-1125637871773577245
Mar 23, 2026
Merged

πŸ›‘οΈ Sentinel: [CRITICAL/HIGH] Fix SSRF vulnerability in network scanner#21
manupawickramasinghe merged 1 commit intomainfrom
sentinel-ssrf-prevention-1125637871773577245

Conversation

@ManupaKDU
Copy link
Contributor

🚨 Severity: HIGH
πŸ’‘ Vulnerability: The is_reachable utility function validated IP format but did not restrict the semantic destination, allowing Server-Side Request Forgery (SSRF). The scanner could be manipulated into pinging loopback (127.0.0.1), link-local (e.g., AWS metadata 169.254.169.254), or multicast addresses.
🎯 Impact: An attacker could use the application to discover and interact with internal network resources, metadata services, or local services that are otherwise inaccessible from the outside.
πŸ”§ Fix: Added checks using ipaddress properties (is_loopback, is_link_local, is_multicast, is_unspecified) to explicitly block these restricted ranges before executing the ping command. Updated tests to use 192.168.1.1 instead of 127.0.0.1 and added a new test case for SSRF prevention. Appended a CRITICAL learning entry to .jules/sentinel.md.
βœ… Verification: Run python3 -m unittest test_testping1.py to verify the tests pass, specifically the new test_is_reachable_ssrf_prevention. Run bandit -r . to ensure no new security warnings were introduced.


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

Add semantic destination validation to the `is_reachable` utility function to prevent Server-Side Request Forgery (SSRF). Block loopback, link-local, multicast, and unspecified IP addresses to prevent the scanner from being manipulated into querying internal metadata services or local host resources.
Update test suite to use standard private IP (192.168.1.1) instead of loopback (127.0.0.1) and add explicit tests for SSRF prevention. Append CRITICAL security learning to Sentinel journal.

Co-authored-by: ManupaKDU <95234271+ManupaKDU@users.noreply.github.com>
@google-labs-jules
Copy link
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 merged commit 3dd390d into main Mar 23, 2026
1 check passed
@manupawickramasinghe manupawickramasinghe deleted the sentinel-ssrf-prevention-1125637871773577245 branch March 23, 2026 05:51
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