feat(security): default follow_redirects to "safe" for SSRF protection

curl_cffi v0.15.0 introduced CurlFollow.SAFE, which follows redirects but rejects those targeting internal/private IPs (loopback, private networks, link-local). This is now the default for all HTTP fetchers, the MCP server, and the shell curl converter.

Added FollowRedirects type alias supporting all curl_cffi redirect
modes: bool, "safe", "all", "obeycode", "firstonly".
This commit is contained in:
Karim shoair
2026-04-05 18:41:50 +02:00
parent 065bf1c0e8
commit e7f9adb40a
6 changed files with 23 additions and 18 deletions
+2 -1
View File
@@ -8,6 +8,7 @@ from scrapling.core._types import (
Optional,
SetCookieParam,
SelectorWaitStates,
FollowRedirects,
)
# Parameter definitions for shell function signatures (defined once at module level)
@@ -26,7 +27,7 @@ _REQUESTS_PARAMS = {
"headers": Any,
"retries": Optional[int],
"retry_delay": Optional[int],
"follow_redirects": Optional[bool],
"follow_redirects": Optional[FollowRedirects],
"max_redirects": Optional[int],
"verify": Optional[bool],
"cert": Optional[str | Tuple[str, str]],