🛡️ Sentinel: [HIGH] Fix SSRF in WebDAV connection test

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
google-labs-jules[bot]
2026-03-15 04:10:11 +00:00
parent 7cd6252bf7
commit 8079db7893
6 changed files with 50 additions and 48 deletions
+2 -2
View File
@@ -523,7 +523,7 @@ class TestURLUploadAdditionalCoverage:
"""Cover DNS resolution failure branch (lines 67-72)."""
import socket as _socket
from app.api.url_upload import is_private_ip
from app.utils.network import is_private_ip
with patch("socket.getaddrinfo", side_effect=_socket.gaierror("nope")):
result = is_private_ip("nonexistent.invalid.hostname.test")
@@ -531,7 +531,7 @@ class TestURLUploadAdditionalCoverage:
def test_is_private_ip_hostname_resolves_to_private(self):
"""Cover branch where hostname resolves to a private IP (line 64-65)."""
from app.api.url_upload import is_private_ip
from app.utils.network import is_private_ip
with patch("socket.getaddrinfo") as mock_gai:
# Simulate resolving to a private IP