Summary
Typebot versions 3.15.2 and earlier contain a server-side request forgery (SSRF) flaw in the HTTP Request and Code blocks, where redirects are followed without re-validating the destination URL.
An authenticated Typebot user can abuse this behavior to make the server reach internal IPs and cloud metadata endpoints, potentially exposing IAM credentials or probing internal services that are otherwise unreachable from the internet.
Affected context
This vulnerability arises in Typebot deployments where:
- The HTTP Request block or Code block is configured to make outbound HTTP calls.
- The validateHttpReqUrl() function is relied on to block access to private IP ranges and metadata endpoints.
- The underlying HTTP clients (such as
kyandfetch) are allowed to automatically follow HTTP 30x redirects.
In such contexts, an authenticated user can design a bot flow that issues requests to an attacker-controlled domain that responds with a redirect to an internal or metadata IP, leveraging the server's network position.
Exploit preconditions
- Attack surface: Typebot server's outbound HTTP functionality invoked by the HTTP Request block or Code block.
- Required access: Authenticated Typebot account with permission to create or edit bots that can execute these blocks.
- Trigger point: A bot execution that issues a request to an attacker-controlled URL which responds with an HTTP redirect (e.g., 302) to an internal or metadata endpoint.
- Why exploitation is possible: The initial URL is validated to avoid private IP and metadata access, but the redirect target is not re-validated. HTTP clients automatically follow redirects, allowing the final request to reach internal network addresses or metadata services from the server's trusted network location.
Why this happens
The core issue is an incomplete SSRF protection pattern: URL validation is performed only on the initial request target, not on subsequent redirect destinations.
This maps to CWE-918: Server-Side Request Forgery (SSRF), where an attacker can coerce the server into making HTTP requests to arbitrary targets.
Architecturally, the HTTP layer assumes that once an origin URL passes validation it is safe, yet it delegates redirect handling to generic HTTP clients (ky, fetch) that automatically follow redirects without enforcing the same network and hostname restrictions on each hop.
The absence of a consistent, centralized validation step for every outbound request hop, combined with trust in application-level redirects, creates a gap that attackers can exploit through open redirect chains.
Potential impact
- Access to cloud instance metadata endpoints (such as
169.254.169.254), which may expose IAM credentials or access tokens. - Network reconnaissance of internal services, including private subnets and container-internal endpoints.
- Potential pivoting into internal APIs that are not exposed to the public internet.
- Use of exposed credentials to escalate privileges in cloud environments.
- Increased blast radius if internal services are misconfigured or lack strong authentication, enabling data access or configuration tampering.
General mitigation guidance
Effective mitigation focuses on hardening outbound HTTP behavior and closing redirect-based gaps in SSRF defenses:
- Apply network- and host-based validation to every outbound request, including all redirect hops; do not assume that a validated initial URL makes subsequent redirects safe.
- Restrict outbound HTTP clients with allowlists of permitted domains or services instead of relying only on blocklists for private IP ranges and metadata hosts.
- Disable or tightly control automatic redirect following for server-side HTTP clients where user-controlled URLs are involved; handle redirects manually and enforce the same validation logic for each new location.
- Introduce a dedicated SSRF guard layer that normalizes and inspects target URLs, IP resolutions, and redirect chains before any network call is executed.
- Run application components with least-privilege cloud roles and limit access to instance metadata where possible, reducing impact if SSRF occurs.
- Segment internal services and require strong authentication and authorization even for requests originating from internal IPs, so the server's trust position cannot be abused.
How teams detect issues like this
Detection should blend code-level inspection with behavioral monitoring:
- Use static analysis and secure code review to identify:
- User-controllable URLs passed into HTTP clients (
fetch,ky, etc.). - Code paths where
redirect: 'follow'or equivalent automatic redirect handling is enabled. - URL validation functions that are only applied to initial URLs and not to redirect targets.
- Enforce secure coding policies that require:
- Validation of all outbound destinations, including redirects.
- Centralized helper functions for HTTP requests that encapsulate SSRF checks.
- Employ dynamic testing (e.g., security tests in CI/CD) that:
- Attempt to reach known internal or metadata IPs via controlled redirects.
- Verify that SSRF protections are enforced at each redirect hop.
- Monitor runtime logs and network telemetry for:
- Outbound requests to link-local addresses (e.g.,
169.254.169.254) or RFC1918 private ranges from application containers. - Unexpected error patterns from internal endpoints accessed by bot executions.

