Summary
Typebot's preview chat endpoint allows unauthenticated users to submit custom bot definitions containing server-side code that can issue arbitrary outbound HTTP requests from the server.
Because the sandboxed fetch function bypasses SSRF URL validation, attackers can abuse this pathway to pivot into internal networks, access cloud metadata services, and exfiltrate sensitive data.
Affected context
This vulnerability affects Typebot deployments that:
- Expose the preview chat endpoint
POST /api/v1/typebots/{typebotId}/preview/startChat - Allow the endpoint to be called without authentication or with weak network-level controls
- Execute user-supplied Typebot definitions containing server-side code blocks within an isolated-vm sandbox
- Rely on SSRF protections implemented only around specific HTTP request blocks, but not around the sandbox
fetchAPI
It is most relevant to self-hosted or managed environments where the Typebot server has network reachability to internal services, cloud metadata endpoints, or other sensitive infrastructure.
Exploit preconditions
- Attack surface: Public or network-exposed preview chat endpoint at
/api/v1/typebots/{typebotId}/preview/startChat. - Required access: No prior authentication is needed if the endpoint is reachable; the attacker only needs network access to the Typebot instance.
- Trigger point: Submission of a crafted Typebot definition payload that includes server-side code using the sandbox
fetchfunction. - Why exploitation is possible: The
fetchfunction inside the isolated-vm environment calls the native Node.jsfetchAPI without passing through thevalidateHttpReqUrlSSRF protection used by the standard HTTP Request block, allowing arbitrary URLs (including internal and metadata endpoints) to be requested from the server's network context.
Why this happens
The underlying issue is a mismatch between security assumptions and implementation around server-initiated HTTP requests executed on behalf of user-supplied logic.
After earlier SSRF mitigations were added, URL validation (validateHttpReqUrl) was applied to the dedicated HTTP Request block but not consistently enforced for all outbound HTTP primitives exposed to users.
In particular, the sandboxed fetch function was wired directly to Node.js' native fetch, bypassing the shared validation layer and reintroducing an SSRF sink reachable from user-controlled Typebot definitions.
This maps primarily to CWE-918: Server-Side Request Forgery, with CWE-862: Missing Authorization contributing because the preview endpoint allows untrusted, unauthenticated clients to trigger privileged server-side network access.
Potential impact
- Access to internal services that are not directly exposed to the internet (e.g., internal APIs, databases, message queues).
- Retrieval of cloud instance metadata, including temporary credentials for cloud providers that expose them via HTTP endpoints.
- Exfiltration of configuration secrets, internal application data, or administrative interfaces accessible only from the Typebot server's network.
- Use of the Typebot server as a pivot point for network mapping, port scanning, or lateral movement within private infrastructure.
- Potential chaining with other vulnerabilities reachable from internal endpoints (e.g., auth bypasses, deserialization bugs) to escalate impact.
General mitigation guidance
Effective mitigation focuses on consistent SSRF protections and strict control over server-side execution of user-supplied logic:
- Centralize outbound HTTP request handling behind a single, reusable abstraction that always applies URL allow-listing, DNS rebinding protections, and scheme/port restrictions.
- Ensure every HTTP-capable primitive exposed to user scripts (including sandboxed
fetchwrappers or custom request helpers) passes through the same SSRF validation logic. - Narrow the trust boundary of preview and testing endpoints by requiring authentication, rate limiting, and/or restricting access to internal networks via gateways or VPNs.
- Reduce the server's effective reach by placing it in a segmented network with minimal access to internal services and sensitive metadata endpoints.
- When sandboxing user code, design the sandbox API surface to default to safe operations, explicitly opt-in to network access where needed, and guard that access with policy checks.
- Apply least-privilege principles to infrastructure credentials and avoid relying on highly privileged instance metadata where alternative mechanisms (e.g., scoped service accounts) exist.
How teams detect issues like this
Detection typically involves a combination of code-level analysis and runtime monitoring:
- Static analysis and code review:
- Search for all call sites of low-level HTTP clients (
fetch,http.request,axios, etc.) and verify they are wrapped in a shared validation layer. - Flag sandbox or plugin APIs that expose direct network primitives to user-controlled inputs without centralized SSRF checks.
- Review endpoints that accept arbitrary definitions, scripts, or configuration and then execute server-side logic derived from those inputs.
- Security testing:
- Include SSRF-focused test cases in API security assessments, targeting preview or "test-only" endpoints that may be less protected.
- Use automated DAST or fuzzing tools configured to probe for SSRF by attempting access to known metadata and internal network markers.
- Operational monitoring:
- Monitor outbound HTTP traffic from Typebot instances for unusual destinations such as cloud metadata IPs (e.g.,
169.254.169.254) or internal-only hostnames. - Implement network egress controls and log policy violations as indicators of possible SSRF exploitation.
- Policy enforcement:
- Integrate pre-merge checks that verify new or modified network calls are routed through SSRF-safe helpers.
- Use automated code review tools that can encode these patterns as rules for continuous enforcement.

