Summary
A server-side request forgery (SSRF) flaw in TypeBot's URL validation allows attackers to bypass network egress restrictions using DNS rebinding.
When a bot fetches attacker-controlled URLs, the hostname is validated once but re-resolved later, enabling connections to internal or metadata endpoints if DNS records change in between.
Affected context
This issue affects TypeBot deployments where bots are configured to perform server-side HTTP requests or script fetches using URLs that can be influenced by untrusted users.
The vulnerability manifests when SSRF validation relies on a one-time DNS resolution of the hostname to check against forbidden IP ranges, but the actual outbound HTTP request later re-resolves the hostname without pinning the approved IP address.
It is most relevant in environments where the TypeBot server has network-level access to private services, cloud metadata endpoints, or internal admin interfaces that are intended to be shielded from external access.
Exploit preconditions
- Attack surface: Server-side HTTP request and script fetch features that accept user-supplied or externally controlled URLs.
- Required access: Ability to create or interact with a bot that performs outbound HTTP requests, and control over a domain name used as the target hostname.
- Trigger point: The bot workflow step that performs the validated HTTP request, which first passes SSRF checks and later issues the real network call.
- Why exploitation is possible: The SSRF guard performs a DNS lookup at validation time and only checks the resulting IP against forbidden ranges. The actual HTTP client later performs its own DNS resolution using the same hostname, so an attacker who controls DNS for that hostname can return a benign IP during validation and then rebind it to a private or metadata IP by the time the request is executed, causing the server to connect to prohibited internal addresses.
Why this happens
The underlying flaw is a time-of-check to time-of-use (TOCTOU) gap in network access control, specifically in the SSRF defense mechanism.
Instead of coupling the validated network endpoint to the actual outbound connection, the implementation validates a transient DNS result and discards it, relying solely on the hostname during the real HTTP call.
This is an instance of CWE-918: Server-Side Request Forgery (SSRF), where server-side HTTP capabilities can be steered toward unintended internal resources.
The DNS rebinding technique exploits the mismatch between the initial security decision and the later network operation, allowing dynamic changes in DNS records to redirect traffic to sensitive internal IP ranges that would otherwise be blocked.
Potential impact
- Disclosure of cloud instance or container metadata, including credentials or access tokens.
- Access to internal admin panels or management interfaces not exposed to the public internet.
- Theft of secrets or configuration data from internal HTTP services.
- Lateral movement within the internal network by interacting with internal-only HTTP APIs.
- Facilitation of further compromise through exploitation of vulnerabilities in internal services.
General mitigation guidance
Robust mitigation centers on ensuring that SSRF validation and actual network use are tightly bound and consistently enforced.
Common defensive patterns include:
- Pinning the validated IP address (or full socket address) to the subsequent HTTP connection, avoiding a second unconstrained DNS resolution.
- Performing SSRF checks on the final destination of the outbound socket connection, including post-redirect targets, rather than on the initial hostname alone.
- Enforcing deny-by-default egress policies that limit which hosts or IP ranges the application can reach, backed by network-layer controls (e.g., firewall rules, egress proxies).
- Using strict allowlists of external endpoints for server-side HTTP requests wherever feasible, particularly for user-configurable integrations.
- Normalizing and re-validating URLs after any transformation, and avoiding implicit trust in DNS responses that can be influenced by untrusted domains.
How teams detect issues like this
Detection strategies typically focus on surfacing SSRF patterns and TOCTOU gaps in URL validation logic:
- Static analysis rules that flag SSRF-prone code paths where user-controlled URLs are passed to HTTP clients without strong constraints, especially when DNS resolution occurs separately from the actual request.
- Code review checklists that call out server-side HTTP features, ensuring they use IP pinning, allowlists, or centralized egress controls and documenting any exceptions.
- Security tests and dynamic analysis that attempt DNS rebinding attacks against URL validation logic, observing whether internal or reserved IP ranges become reachable.
- Integration of automated security scanners or SAST tools into CI pipelines to detect SSRF-related anti-patterns, such as validation based solely on hostnames or initial DNS lookups.

