Back to Intelligence

CVE-2026-140094: OpenShift TemplateInstance Privilege Escalation (CVSS 9.9) — Detection & Remediation Guide

SA
Security Arsenal Team
December 1, 2026
10 min read

The NVD has published CVE-2026-140094, a CVSS 9.9 (Critical) flaw in the OpenShift API server that every organization running self-managed Red Hat OpenShift clusters needs to treat as a patch-now event. The vulnerability lives in the TemplateInstance instantiation mechanism: incomplete authorization checks allow an authenticated user — including one holding nothing more than the default self-provisioner role — to submit a TemplateInstance request containing forged group memberships, including system:cluster-admins. Because the openshift-controller-manager trusts those unvalidated groups when it processes the request, the attacker's actions execute with cluster-admin authority.

Let me be blunt about why this scores 9.9: the attack is network-exploitable, requires only low-privilege authenticated access, needs no user interaction, and results in a complete confidentiality, integrity, and availability compromise of the cluster — and potentially everything running on it. In my experience, "any authenticated user becomes cluster-admin" is the single most dangerous vulnerability class in Kubernetes ecosystems, because the self-provisioner role is granted by default to virtually every authenticated user in a standard OpenShift deployment. Your intern's service account is one API call away from owning the control plane.

Technical Analysis

Affected Component

  • Product: Red Hat OpenShift Container Platform (openshift-apiserver, with exploitation realized through openshift-controller-manager)
  • Vulnerable mechanism: TemplateInstance instantiation (template.openshift.io/v1)
  • CVE: CVE-2026-140094 — CVSS v3.1 base score 9.9 (Critical), network attack vector
  • Prerequisite: Authenticated access with permission to create TemplateInstances — satisfied by the default self-provisioner cluster role

How the Attack Works (Defender's View)

The kill chain is short and entirely API-driven:

  1. Recon (trivial): The attacker authenticates to the OpenShift API with any standard account. Default RBAC grants self-provisioner, which includes the ability to create projects and instantiate templates.
  2. Weaponization: The attacker crafts a TemplateInstance object whose requester context specifies arbitrary group memberships — e.g., system:cluster-admins or system:masters. The openshift-apiserver fails to validate that the requesting user actually belongs to those groups.
  3. Execution: The request is passed to openshift-controller-manager, which processes the template instantiation as if the requester genuinely held those group memberships. Template parameters, object creation, secret references — all execute with cluster-admin-equivalent privileges.
  4. Post-exploitation: From cluster-admin, the attacker can create privileged pods, read every Secret in every namespace (harvesting registry credentials, cloud provider keys, service account tokens), deploy cryptominers or persistence webhooks, create new ClusterRoleBindings for durable access, and pivot into the underlying node OS via privileged containers or oc debug node.

The critical defender takeaway: this is not a container escape or a memory corruption bug — it's a logic flaw in an authorization path. There is no exploit payload to signature. The only reliable telemetry is the API request itself and the privileged actions that follow it. That means Kubernetes/OpenShift audit logging is your primary detection surface.

Exploitation Status

As of publication, CVE-2026-140094 has been publicly disclosed via NVD. No CISA KEV listing or confirmed in-the-wild exploitation has been reported at time of writing — but the barrier to weaponization is effectively zero. The attack requires nothing more than oc or curl against the API and a low-privilege account. Treat exploitation as imminent: red teams will have this in their playbooks within days, and any cluster with exposed or weakly governed developer access is at immediate risk. If your API server is reachable from the internet (a configuration we still find routinely during penetration tests), the urgency doubles.

Detection & Response

Your ground truth is the OpenShift/Kubernetes API audit log. Ensure audit logging is enabled at Metadata level at minimum (ideally Request or RequestResponse for the template.openshift.io group) and that logs are shipped off-cluster to your SIEM. The detections below target the three observable behaviors: the forged TemplateInstance request, the downstream RBAC abuse, and service-account token abuse from new privileged bindings.

SIGMA Rules

These rules assume Kubernetes/OpenShift audit logs normalized via a Sigma-compatible pipeline (e.g., via kube-apiserver audit webhook into your SIEM).

YAML
---
title: OpenShift TemplateInstance Created With Forged Privileged Groups
id: 4f8c2a91-7e3d-4b6a-9c21-5d8f0a2b3e71
status: experimental
description: Detects TemplateInstance creation requests that assert membership in privileged system groups (system:cluster-admins, system:masters), consistent with CVE-2026-140094 exploitation in openshift-apiserver.
references:
  - https://nvd.nist.gov/vuln/detail/CVE-2026-140094
author: Security Arsenal
date: 2026/01/15
tags:
  - attack.privilege_escalation
  - attack.t1078
logsource:
  product: kubernetes
  service: audit
detection:
  selection:
    objectRef.resource: 'templateinstances'
    objectRef.apiGroup: 'template.openshift.io'
    verb: 'create'
  forged_groups:
    requestObject|contains:
      - 'system:cluster-admins'
      - 'system:masters'
      - 'system:cluster-readers'
  condition: selection and forged_groups
falsepositives:
  - None expected - no legitimate workflow should inject system-level groups into TemplateInstance requests
level: critical
---
title: Suspicious ClusterRoleBinding Granting Cluster-Admin by Non-System User
id: 8b1e6d42-3f9a-4c7b-a5d2-6e9f1c4a8b05
status: experimental
description: Detects creation of ClusterRoleBindings granting cluster-admin by interactive or developer-tier users, a common post-exploitation persistence step following privilege escalation such as CVE-2026-140094.
references:
  - https://attack.mitre.org/techniques/T1078/
  - https://nvd.nist.gov/vuln/detail/CVE-2026-140094
author: Security Arsenal
date: 2026/01/15
tags:
  - attack.persistence
  - attack.privilege_escalation
  - attack.t1078
logsource:
  product: kubernetes
  service: audit
detection:
  selection:
    objectRef.resource: 'clusterrolebindings'
    verb: 'create'
    requestObject|contains:
      - 'cluster-admin'
      - 'system:masters'
  exclude_system:
    user.username|startswith:
      - 'system:admin'
      - 'system:kube-'
      - 'system:serviceaccount:openshift-'
      - 'system:serviceaccount:kube-system'
  condition: selection and not exclude_system
falsepositives:
  - Cluster administrators performing legitimate RBAC changes during platform maintenance windows
level: high
---
title: OpenShift OAuth Token Used From Unexpected Impersonation Context
id: 2c7a9f53-1d4e-4b8c-9a63-7f2e5b1d6c94
status: experimental
description: Detects API requests where the asserted user groups contain privileged system groups but the username belongs to a developer-tier account, indicating forged group propagation as seen in CVE-2026-140094.
references:
  - https://nvd.nist.gov/vuln/detail/CVE-2026-140094
author: Security Arsenal
date: 2026/01/15
tags:
  - attack.privilege_escalation
  - attack.defense_evasion
  - attack.t1078
logsource:
  product: kubernetes
  service: audit
detection:
  selection:
    user.groups|contains:
      - 'system:cluster-admins'
      - 'system:masters'
  exclude_known_admins:
    user.username|startswith:
      - 'system:admin'
      - 'system:kube-'
      - 'kube-admin'
  condition: selection and not exclude_known_admins
falsepositives:
  - Legitimate cluster administrator accounts in organizations with human cluster-admins (tune exclusion list to your IdP group mapping)
level: high

KQL (Microsoft Sentinel)

This hunt assumes OpenShift API audit logs are ingested into Sentinel via Syslog/Fluent Bit (or a custom log connector). It surfaces forged TemplateInstance requests and the follow-on cluster-admin binding creations. If you ingest via a custom table (KubeAudit_CL), swap the table name accordingly.

KQL — Microsoft Sentinel / Defender
// Hunt 1: TemplateInstance creation asserting privileged system groups (CVE-2026-140094)
let PrivilegedGroups = dynamic(["system:cluster-admins", "system:masters", "system:cluster-readers"]);
Syslog
| where SyslogMessage has "templateinstances" and SyslogMessage has "create"
| extend AuditJson = todynamic(extract(@"(\{.*\})", 1, tostring(SyslogMessage)))
| extend Verb = tostring(AuditJson.verb),
         User = tostring(AuditJson.user.username),
         UserGroups = tostring(AuditJson.user.groups),
         RequestObj = tostring(AuditJson.requestObject),
         SourceIP = tostring(AuditJson.sourceIPs)
| where Verb == "create"
| where RequestObj has_any (PrivilegedGroups) or UserGroups has_any (PrivilegedGroups)
| where User !startswith "system:"
| project TimeGenerated, Computer, User, SourceIP, Verb, RequestObj
| order by TimeGenerated desc;

// Hunt 2: Post-exploitation - cluster-admin ClusterRoleBinding created by non-system principals
Syslog
| where SyslogMessage has "clusterrolebindings" and SyslogMessage has "cluster-admin"
| extend AuditJson = todynamic(extract(@"(\{.*\})", 1, tostring(SyslogMessage)))
| extend Verb = tostring(AuditJson.verb),
         User = tostring(AuditJson.user.username),
         SourceIP = tostring(AuditJson.sourceIPs)
| where Verb == "create"
| where User !startswith "system:" and User != "kube-admin"
| project TimeGenerated, Computer, User, SourceIP, Verb, SyslogMessage
| order by TimeGenerated desc

Velociraptor VQL

If you have Velociraptor deployed on control-plane nodes (or log aggregation hosts), this artifact hunts the on-disk API audit logs for forged TemplateInstance requests — useful for retro-hunting to establish whether exploitation predates your alerting.

VQL — Velociraptor
-- Retro-hunt OpenShift API audit logs for forged TemplateInstance requests (CVE-2026-140094)
SELECT FullPath,
       Line
FROM foreach(row={
    SELECT FullPath
    FROM glob(globs=["/var/log/kube-apiserver/audit*.log",
                     "/var/log/openshift-apiserver/audit*.log"])
}, query={
    SELECT FullPath,
           Line
    FROM parse_lines(filename=FullPath, accessor="file")
    WHERE Line =~ "templateinstances"
      AND Line =~ "system:cluster-admins|system:masters"
})

Remediation & Hardening Script

Run this on a bastion with oc authenticated as a cluster-admin. It verifies cluster version, audits existing exposure, hunts for forged TemplateInstances in live objects, and applies an emergency RBAC workaround.

Bash / Shell
#!/usr/bin/env bash
# CVE-2026-140094 - OpenShift TemplateInstance Privilege Escalation
# Verification, hunting, and emergency mitigation script
set -euo pipefail

# 1. Verify cluster version - compare against Red Hat patched z-stream releases
echo "=== Cluster Version ==="
oc get clusterversion version -o jsonpath='{.status.desired.version}{"\n"}'
oc get clusteroperators | grep -E 'apiserver|controller-manager'

# 2. Identify who can create TemplateInstances (attack prerequisite)
echo "=== Principals able to create TemplateInstances ==="
oc adm policy who-can create templateinstances.template.openshift.io --all-namespaces

# 3. Hunt live TemplateInstances for forged requester groups
echo "=== TemplateInstances with privileged requester groups ==="
oc get templateinstances.template.openshift.io --all-namespaces -o json | \
  jq -r '.items[] | select((.spec.requester.groups // []) | any(. == "system:cluster-admins" or . == "system:masters")) | "\(.metadata.namespace)/\(.metadata.name) requester=\(.spec.requester.username) groups=\(.spec.requester.groups)"'

# 4. Hunt recent audit logs on control-plane nodes for forged requests (if accessible)
echo "=== Audit log indicators (last entries) ==="
for node in $(oc get nodes -l node-role.kubernetes.io/master= -o name); do
  echo "--- ${node} ---"
  oc debug "${node}" --quiet -- chroot /host bash -c \
    'grep -h "templateinstances" /var/log/kube-apiserver/audit*.log 2>/dev/null | grep -E "system:cluster-admins|system:masters" | tail -n 20' || true
done

# 5. Detect persistence: non-system ClusterRoleBindings granting cluster-admin
echo "=== Suspicious cluster-admin bindings ==="
oc get clusterrolebindings -o json | \
  jq -r '.items[] | select(.roleRef.name=="cluster-admin") | .subjects[]? | select(.name != null) | select(.name | startswith("system:") | not) | "\(.kind)/\(.name)"' | sort -u

# 6. EMERGENCY WORKAROUND (until patched): strip TemplateInstance creation from self-provisioner
# WARNING: This breaks developer self-service template workflows. Test in staging first.
echo "=== Applying emergency RBAC workaround ==="
oc annotate clusterrole self-provisioner rbac.authorization.kubernetes.io/autoupdate=false --overwrite
oc adm policy remove-cluster-role-from-user self-provisioner system:authenticated:oauth || true
echo "Workaround applied. Re-enable post-patch with: oc annotate clusterrole self-provisioner rbac.authorization.kubernetes.io/autoupdate- --overwrite"

Remediation

1. Patch immediately. Upgrade affected OpenShift clusters to the fixed z-stream release referenced in Red Hat's security advisory for CVE-2026-140094 (see the NVD entry at https://nvd.nist.gov/vuln/detail/CVE-2026-140094 and the linked Red Hat Customer Portal errata for your 4.x channel). Given CVSS 9.9 with default-configuration exploitability, this belongs in your emergency change window, not the next maintenance cycle. Verify the openshift-apiserver and openshift-controller-manager operators report Available=True and Progressing=False post-upgrade.

2. Apply the RBAC workaround if you cannot patch within 24 hours. Temporarily remove TemplateInstance creation rights from self-provisioner and any custom roles that don't strictly need them (script above, step 6). Alternatively, deploy a ValidatingAdmissionPolicy (or Gatekeeper/Kyverno policy) that rejects any TemplateInstance whose spec.requester.groups contains entries matching system:*. This blocks the exploitation path at admission while preserving legitimate template workflows.

3. Audit before you patch — assume breach. Run the retro-hunt (VQL artifact and script steps 3–5) across retained audit logs going back at least 90 days. Any forged TemplateInstance request means you have an IR engagement, not a patch ticket: rotate all cluster secrets, review every ClusterRoleBinding created after the first forged request, redeploy workloads that may have been tampered with, and inspect for persistence webhooks (MutatingWebhookConfiguration/ValidatingWebhookConfiguration created outside GitOps).

4. Harden the long-term posture. Remove self-provisioner from system:authenticated:oauth permanently if your operating model allows — developer self-service should flow through governed project-request automation, not blanket permissions. Enable RequestResponse audit policy for the template.openshift.io API group, ship audit logs off-cluster in near-real-time, and alert on any human principal asserting system:* group membership. Finally, inventory which clusters have API endpoints reachable from the internet; CVE-2026-140094 requires authentication, but public exposure combined with credential stuffing is how "authenticated-only" bugs become front-page breaches.

Related Resources

Security Arsenal Penetration Testing Services AlertMonitor Platform Book a SOC Assessment vulnerability-management Intel Hub

Is your security operations ready?

Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.