Summary
Kyverno contains a server-side request forgery vulnerability in the apiCall.service.url field, where authenticated users may influence HTTP destinations through variable substitution. Successful exploitation could allow requests to internal services, cloud metadata endpoints, or loopback addresses, with response data reflected in admission error messages.
Affected context
The vulnerability affects Kyverno configurations that use apiCall.service.url with user-controlled or insufficiently constrained variable substitution. It becomes risky when an authenticated user can influence values inserted into the service URL and Kyverno can reach internal network resources or return upstream responses through admission errors. Deployments with restricted egress and tightly controlled policy inputs may reduce exposure.
Exploit preconditions
- Attack surface: Kyverno policy evaluation through the
apiCall.service.urlfeature - Required access: Authenticated access sufficient to influence inputs used in variable substitution or submit requests evaluated by the affected policy
- Trigger point: An admission or policy-processing operation that constructs and sends the service URL
- Why exploitation is possible: User-controlled values can influence the destination of server-side HTTP requests, while response content may be reflected in admission error messages
Why this happens
The underlying bug is insufficient separation between trusted service destinations and user-controlled variable values. When variable substitution can affect an outbound request URL without strong destination validation, the server may be induced to contact resources that were not intended by the policy author. This behavior maps to CWE-918: Server-Side Request Forgery, including the possibility of response reflection that makes otherwise blind requests observable.
Potential impact
- An attacker may access services on internal network interfaces
- Cloud instance metadata or other sensitive endpoint responses could be disclosed
- Loopback and host-local services could be queried
- Response data may be exfiltrated through admission error messages
- Internal service exposure could support further compromise or reconnaissance
General mitigation guidance
Mitigation generally focuses on ensuring that outbound request destinations are trusted, constrained, and independent of untrusted input.
Common defensive patterns include:
- Allowlisting approved schemes, hosts, ports, and paths for service requests
- Keeping destination components separate from user-controlled variables
- Rejecting loopback, link-local, private, and other restricted network ranges where they are not required
- Applying egress network policies and firewall controls to limit reachable services
- Avoiding reflection of upstream response bodies in admission errors
- Running Kyverno with only the network and privileges required for its function
- Treating policy inputs and admission-request data as untrusted by default
How teams detect issues like this
Organizations can identify SSRF risks through:
- Static analysis for request URLs assembled from admission data, variables, or other untrusted inputs
- Code and policy reviews that examine
apiCall.service.urlconstruction and substitution boundaries - Configuration policies requiring destination allowlists and rejecting restricted address ranges
- Network monitoring for unexpected requests from Kyverno components to metadata services, loopback addresses, or internal administrative endpoints
- Admission-log analysis for unusual outbound destinations or error messages containing upstream response data
- Automated security review tools that flag dynamic URL construction and missing egress restrictions

