fix(security): reject embedded URL credentials

This commit is contained in:
Rishi Gupta committed 2026-10-21 22:28:45 +05:30
1 parent 847a93f3ca
commit 2fac78e8ed
1 file changed
+3
+3
View File
@@ -115,6 +115,9 @@ def validate_url(url: str) -> str:
f"Got: {url!r}"
)
if parsed.username is not None or parsed.password is not None:
raise ValueError(f"Blocked URL containing embedded credentials. Got: {url!r}")
hostname = parsed.hostname
if hostname:
# Block known cloud metadata hostnames