Summary
Kestra's HTTP function can send requests to attacker-selected destinations without restricting private, loopback, or link-local addresses. An unauthenticated attacker who can import and execute a flow may use this behavior to access internal services or cloud metadata.
Affected context
The vulnerability occurs in Kestra deployments where the Pebble http() function accepts a user-controlled URI and passes it to the server-side HTTP client without destination validation. It becomes risky when an unauthenticated user can import and execute flows and the Kestra server has network access to internal services, loopback interfaces, link-local endpoints, or cloud metadata services.
Exploit preconditions
- Attack surface: Kestra flow import and execution, specifically the Pebble
http()function - Required access: Ability to import and execute a flow; authentication may not be required depending on deployment exposure
- Trigger point: Evaluation of a flow containing a user-controlled HTTP URI
- Network condition: The Kestra server must be able to reach the targeted internal or metadata endpoint
- Why exploitation is possible: The HTTP client accepts attacker-influenced destinations without enforcing private, loopback, or link-local address restrictions
Why this happens
The underlying bug is server-side request forgery, mapped to CWE-918. The application treats a user-controlled URI as a permitted outbound destination and forwards it to a server-side HTTP client without applying a trusted destination policy. This allows request routing to network locations that should be inaccessible to untrusted flow authors, including internal services and link-local metadata endpoints.
Potential impact
- An attacker may read responses from internal services
- Cloud credentials or instance metadata could be exposed
- Internal administrative interfaces could be accessed
- The vulnerability could enable reconnaissance of protected network segments
- Downstream services may be affected through unauthorized server-originated requests
General mitigation guidance
Mitigation generally focuses on enforcing an explicit outbound destination policy for server-side HTTP requests.
Common defensive patterns include:
- Allowlisting approved schemes, hosts, ports, and destination networks
- Resolving hostnames and validating the resulting IP addresses before connecting
- Blocking loopback, private, link-local, multicast, and other non-routable destinations
- Rechecking the destination after redirects and preventing policy bypass through DNS rebinding
- Separating flow-authoring privileges from flow-execution privileges
- Restricting server egress with network policies or equivalent firewall controls
- Avoiding exposure of cloud metadata services to application workloads where possible
- Limiting the permissions of the Kestra runtime and downstream service identities
How teams detect issues like this
Organizations can identify SSRF risks through:
- Static analysis rules for user-controlled URLs passed to HTTP clients
- Code review checks for missing destination, redirect, scheme, and IP-range validation
- Tests covering private, loopback, link-local, IPv6, encoded, redirected, and DNS-rebinding destinations
- Runtime monitoring of outbound requests from Kestra workers or servers
- Egress policies that alert on or deny connections to restricted address ranges
- Automated security review tools that flag server-side requests using untrusted URI values

