Skip to content

πŸ›‘οΈ Sentinel: [HIGH] Fix SSRF bypass via CGNAT addresses#67

Merged
manupawickramasinghe merged 1 commit intomainfrom
sentinel/cgnat-ssrf-prevention-10266931522975799708
Apr 29, 2026
Merged

πŸ›‘οΈ Sentinel: [HIGH] Fix SSRF bypass via CGNAT addresses#67
manupawickramasinghe merged 1 commit intomainfrom
sentinel/cgnat-ssrf-prevention-10266931522975799708

Conversation

@ManupaKDU
Copy link
Copy Markdown
Contributor

🚨 Severity: HIGH
πŸ’‘ Vulnerability: Server-Side Request Forgery (SSRF) bypass via Carrier-Grade NAT (CGNAT) and other non-global IP ranges. The Python ipaddress module's is_private property evaluates CGNAT addresses (e.g., 100.64.0.0/10) as False, allowing them to bypass standard SSRF filters.
🎯 Impact: Attackers could potentially bypass SSRF protections to scan internal shared infrastructure if the hosting environment natively routes these non-public ranges.
πŸ”§ Fix: Appended not getattr(ip, 'is_global', True) to the is_blocked logic for the primary IP and unwrapped IPv4/IPv6 addresses to safely block any non-global IPs while gracefully degrading on older Python versions.
βœ… Verification: Added test_is_reachable_ssrf_cgnat_prevention unit test to test_testping1.py and ran the full test suite (python3 -m unittest test_testping1.py) successfully.


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

- Added `not getattr(ip, 'is_global', True)` check to properly block Carrier-Grade NAT (CGNAT) ranges (e.g., `100.64.0.0/10`) and other non-global IP blocks.
- Applied the check to the primary IP object and all unwrapped/embedded IPv4 payloads.
- Added a unit test to verify that CGNAT addresses are correctly rejected.

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 merged commit 98877c2 into main Apr 29, 2026
1 check 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.

2 participants