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. --- ### 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 ``` This occurs when no explicit `Authorization` header is defined in the policy. #### Root cause ```go 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 ```bash kubectl run capture --image=python:3-slim --restart=Never -- \ python3 -c " import http.server class H(http.server.BaseHTTPRequestHandler): def do_GET(self): prin
GHSA-8wfp-579w-6r25
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: osv:GHSA-8wfp-579w-6r25
github.com/kyverno/kyverno
Source reference: /affected/0/package/name
- Affected versions
- Not stated in this record
- Fixed versions
- 1.17.0
Source reference:
/affected/0/ranges - Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0"
},
{
"fixed": "1.17.0"
}
]
}
],
"package": {
"name": "github.com/kyverno/kyverno",
"purl": "pkg:golang/github.com/kyverno/kyverno",
"ecosystem": "Go"
},
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-8wfp-579w-6r25/GHSA-8wfp-579w-6r25.json"
}
}
]- Related CVEs
- CVE-2026-84195
Source reference:
/aliases
Publisher severity
high
Source reference: /database_specific/severity
- Event
- #15266 · Revision 1
- Added to Heist Feed
- Publisher date