mirror of
https://github.com/safishamsi/graphify.git
synced 2026-10-25 16:22:30 +00:00
fix(security): reject embedded URL credentials
This commit is contained in:
1 parent
847a93f3ca
commit
2fac78e8ed
1 file changed
+3
@@ -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
|
||||
|
||||
Reference in new issue
Block a user