Summary
Kyverno before 1.16.2 contains a server-side request forgery vulnerability in the APICall feature because Policy ServiceCall URLs are not sufficiently validated.
A user able to create namespace-level Policies may direct Kyverno to request internal resources, potentially exposing tenant data, cloud metadata, or IAM credentials through the resulting PolicyReport.
Affected context
The vulnerability occurs in Kyverno deployments that permit users to create Policies with the APICall or ServiceCall feature. Risk is elevated when Kyverno can reach internal services, cloud metadata endpoints, or resources belonging to other tenants, and when PolicyReports are readable by the Policy author. The impact is amplified because requests run under Kyverno's cluster-wide high-privilege ServiceAccount.
Exploit preconditions
- Attack surface: Kyverno Policy creation and the APICall or ServiceCall feature
- Required access: Permission to create namespace-level Policies and read the resulting PolicyReport
- Trigger point: Kyverno evaluates the Policy and performs the configured HTTP request
- Why exploitation is possible: The requested URL is not adequately restricted, allowing a lower-privileged user to induce Kyverno to access resources using its more privileged network position and identity
Why this happens
The underlying flaw is insufficient validation and authorization of user-controlled outbound request destinations. A Policy author can supply a URL that causes Kyverno to act as a trusted intermediary, which is a server-side request forgery condition mapped to CWE-918.
The confused-deputy behavior occurs because Kyverno performs the request with its cluster-wide ServiceAccount and returns the response through a PolicyReport, allowing the initiating user to potentially access information beyond their intended permissions.
Potential impact
- An attacker may access internal services that are not directly reachable from their own workload
- Responses could expose other tenants' secrets or configuration data
- Cloud instance metadata requests could reveal temporary IAM credentials
- An attacker could use obtained credentials for unauthorized cloud or cluster actions
- Multi-tenant isolation could be weakened
- Internal service availability or integrity could be affected if unsafe methods are permitted
General mitigation guidance
Mitigation generally focuses on restricting both the destinations Kyverno can contact and the authority under which requests execute.
Common defensive patterns include:
- Enforcing strict URL validation with allowlisted schemes, hosts, ports, and paths
- Blocking link-local, loopback, private, and cluster-internal address ranges unless explicitly required
- Applying egress network policies that limit Kyverno to approved services
- Avoiding broad ServiceAccount permissions and separating request execution from cluster-wide identities
- Limiting which users and namespaces can create Policies containing outbound request features
- Restricting access to PolicyReports and minimizing response data returned to Policy authors
- Using secure-by-default request methods, redirects, and DNS handling
How teams detect issues like this
Detection can combine configuration review, runtime monitoring, and policy enforcement.
Useful approaches include:
- Static analysis for user-controlled URLs passed to HTTP request features without allowlist validation
- Code review checks for unrestricted redirects, DNS rebinding exposure, and private-address access
- Admission policies that restrict APICall or ServiceCall usage and enforce approved destinations
- Network telemetry identifying Kyverno requests to metadata services, private ranges, or unexpected tenants
- Audit review of Policy creation, PolicyReport reads, and unusual outbound requests from Kyverno
- Automated security review tools that flag SSRF-prone URL construction and excessive ServiceAccount privileges

