mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-07-08 08:25:09 +00:00
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -48,8 +48,11 @@ def _assert_safe_peer(sock: Any) -> None:
|
|||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
peer = sock.getpeername()
|
peer = sock.getpeername()
|
||||||
except OSError:
|
except OSError as exc:
|
||||||
return
|
raise ValueError(
|
||||||
|
"Unable to determine the connected peer address; blocking request to prevent SSRF. "
|
||||||
|
"Set CREWAI_TOOLS_ALLOW_UNSAFE_PATHS=true to bypass."
|
||||||
|
) from exc
|
||||||
ip_str = str(peer[0])
|
ip_str = str(peer[0])
|
||||||
if _is_private_or_reserved(ip_str):
|
if _is_private_or_reserved(ip_str):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
|
|||||||
Reference in New Issue
Block a user