Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Note redirect caveat in safeRequest rule

bernie-g2257e46a40c1
diff --git a/.greptile/config.json b/.greptile/config.json
index b6789427d9..64e4457bce 100644
--- a/.greptile/config.json
+++ b/.greptile/config.json
@@ -10,7 +10,7 @@
"rules": [
{
"id": "use-safe-request-for-user-urls",
- "rule": "When making HTTP requests to user-supplied URLs (webhooks, app connections, syncs, rotations, etc.), use safeRequest from backend/src/lib/validator/safe-request.ts instead of blockLocalAndPrivateIpAddresses. blockLocalAndPrivateIpAddresses validates the host but is vulnerable to DNS rebinding: DNS can resolve to an internal IP between the validation check and the actual connect. safeRequest closes that window by validating and pinning the connection to the validated IP, and is a drop-in replacement for axios usage. Flag new code that calls blockLocalAndPrivateIpAddresses, validateSsrfUrl, ssrfSafeGet, or ssrfSafePost (wrappers with the same validate-then-connect flaw), or passes a user-controlled URL to axios/fetch directly without safeRequest.",
+ "rule": "When making HTTP requests to user-supplied URLs (webhooks, app connections, syncs, rotations, etc.), use safeRequest from backend/src/lib/validator/safe-request.ts instead of blockLocalAndPrivateIpAddresses. blockLocalAndPrivateIpAddresses validates the host but is vulnerable to DNS rebinding: DNS can resolve to an internal IP between the validation check and the actual connect. safeRequest closes that window by validating and pinning the connection to the validated IP. Note: safeRequest disables redirects (maxRedirects=0), so call sites that need to follow redirects require redirect-aware handling that re-validates and pins each hop, not a mechanical swap. Flag new code that calls blockLocalAndPrivateIpAddresses, validateSsrfUrl, ssrfSafeGet, or ssrfSafePost (wrappers with the same validate-then-connect flaw), or passes a user-controlled URL to axios/fetch directly without safeRequest.",
"severity": "high",
"scope": ["backend/src/**"]
},