mirror of
https://github.com/safishamsi/graphify.git
synced 2026-10-25 08:11:54 +00:00
fix(security): reject HTTP URLs without a hostname
This commit is contained in:
1 parent
847a93f3ca
commit
6f4782affa
1 file changed
+3
@@ -116,6 +116,9 @@ def validate_url(url: str) -> str:
|
||||
)
|
||||
|
||||
hostname = parsed.hostname
|
||||
if not hostname:
|
||||
raise ValueError(f"Blocked URL without a hostname. Got: {url!r}")
|
||||
|
||||
if hostname:
|
||||
# Block known cloud metadata hostnames
|
||||
if hostname.lower() in _BLOCKED_HOSTS:
|
||||
|
||||
Reference in new issue
Block a user