Summary
Flyto2 Core's URL validation can be bypassed when a hostname resolves to a public address during validation but to an internal address when the HTTP client connects. A low-privileged caller who controls the hostname's DNS may be able to access readable internal or metadata-service responses if the DNS change succeeds between those lookups.
Affected context
The issue occurs in Flyto2 Core's URL validation and HTTP request flow. The validator checks a resolved hostname but returns the hostname URL, allowing the HTTP client to perform a separate DNS lookup when connecting. Modules that rely on this flow may be affected when a caller can provide a hostname and control its DNS responses.
Exploit preconditions
- Attack surface: Modules that use the affected URL-validation and HTTP request flow
- Required access: A low-privileged caller able to supply a hostname and control its DNS
- Trigger point: The HTTP request performs a connection-time DNS lookup after validation
- Why exploitation is possible: DNS can return a public address during validation and an internal address at connection time; success depends on a timing-sensitive change between lookups
Why this happens
The validation and connection steps do not use the same resolved address. The validator checks a hostname but returns the original hostname URL, so the HTTP client resolves it independently when connecting. This creates a time-of-check/time-of-use condition (CWE-367) that can bypass server-side request forgery protections (CWE-918) when DNS answers change between the check and use.
Potential impact
- An attacker may retrieve readable responses from internal services.
- Requests could reach cloud metadata services and expose accessible metadata.
- Internal endpoints may be accessed through modules that rely on the affected request flow.
General mitigation guidance
Defensive patterns focus on ensuring that the address permitted during validation is the address used for the connection.
- Resolve hostnames once, validate the resulting addresses, and bind the connection to an approved address.
- Recheck the connected peer address and reject private, loopback, link-local, or otherwise disallowed ranges.
- Apply outbound network controls to limit access to internal services and metadata endpoints.
- Prefer allowlisted destinations where practical, and minimize caller control over request targets.
- Run workflow components with least-privilege network access.
How teams detect issues like this
- Review URL-validation code for cases where a hostname is checked but the original hostname is later passed to a client that resolves it again.
- Use static analysis to flag SSRF defenses that do not bind validation to the actual connection address.
- Check that outbound request policies cover private, loopback, link-local, and metadata-service ranges.
- Monitor outbound requests for unexpected destination changes or connections to restricted address ranges.
- Include DNS-rebinding scenarios in security testing of modules that accept caller-controlled URLs.

