Commit 5149f12
🛡️ Sentinel: [HIGH] Fix SSRF bypass by explicitly blocking private and CGNAT IPs (#627)
* 🛡️ Sentinel: [HIGH] Fix SSRF bypass by blocking private, multicast, and CGNAT IP spaces
- Added `_is_safe_ip` helper to explicitly reject IPs that are private, multicast, unspecified, loopback, link-local, or within the CGNAT range (100.64.0.0/10).
- Updated `validate_hostname` to use this helper for both IP literals and DNS resolution.
- Resolves vulnerability where `is_global = False` alone didn't adequately block CGNAT or specific edge-case private IPs depending on Python versions.
Co-authored-by: abhimehro <84992105+abhimehro@users.noreply.github.com>
* 🛡️ Sentinel: [HIGH] Fix SSRF bypass by explicitly blocking private and CGNAT IPs
- Added `_is_safe_ip` helper to explicitly reject IPs that are multicast or within the CGNAT range (100.64.0.0/10).
- Relies directly on `.is_global` for remaining checks (which correctly covers private, loopback, unspecified, and link-local).
- Declared the CGNAT network at the module level to avoid instantiation on every check.
- Resolves vulnerability where `.is_global` alone didn't adequately block CGNAT IPs depending on Python version.
Co-authored-by: abhimehro <84992105+abhimehro@users.noreply.github.com>
* Update main.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* 🛡️ Sentinel: [HIGH] Fix SSRF bypass by explicitly blocking private and CGNAT IPs
- Added `_is_safe_ip` helper to explicitly reject IPs that are multicast or within the CGNAT range (100.64.0.0/10).
- Relies directly on `.is_global` for remaining checks (which correctly covers private, loopback, unspecified, and link-local).
- Declared the CGNAT network at the module level to avoid instantiation on every check.
- Resolves vulnerability where `.is_global` alone didn't adequately block CGNAT IPs depending on Python version.
Co-authored-by: abhimehro <84992105+abhimehro@users.noreply.github.com>
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>1 parent 84161fc commit 5149f12
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1022 | 1022 | | |
1023 | 1023 | | |
1024 | 1024 | | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
1025 | 1037 | | |
1026 | 1038 | | |
1027 | 1039 | | |
| |||
0 commit comments