Merge pull request #807 from christianlouis/sentinel-fix-ssrf-dns-resolution-16520734505214840647

🛡️ Sentinel: [HIGH] Fix SSRF bypass on DNS resolution failure
This commit is contained in:
Christian Krakau-Louis
2026-03-23 15:12:16 +01:00
committed by GitHub
4 changed files with 23 additions and 15 deletions
+5 -5
View File
@@ -27,8 +27,8 @@ def is_private_ip(hostname: str) -> bool:
return True
return False
except (socket.gaierror, socket.error):
# Cannot resolve - allow for testing/development
# In production, DNS should work properly
# Log this for debugging
logger.warning(f"Could not resolve hostname: {hostname}")
return False # Changed from True to False to allow external domains in tests
# Cannot resolve.
# Fail securely: block unresolved domains to prevent DNS rebinding
# and SSRF bypasses via unresolvable addresses.
logger.warning(f"Could not resolve hostname (blocking securely): {hostname}")
return True