CVE-2025-1974: How ingress-nginx Admission Webhook Became a 9.8 RCE Vector
This article dissects the Kubernetes Admission Webhook pipeline, explains how ingress-nginx's 8443 port bypassed authentication to enable CVE-2025-1974 RCE via annotation injection and nginx -t exploitation, and provides practical mitigation steps including version upgrades, NetworkPolicy pitfalls, and emergency webhook disabling.
Reading font

Introduction
Many platform engineers encounter two common scenarios: kubectl apply hangs with failed calling webhook errors, or security scans flag CVE-2025-1974 (IngressNightmare) pointing to the rarely touched ingress-nginx-admission component. This article explains why a component designed to block misconfigurations became a critical 9.8 CVSS remote code execution (RCE) vector.
What Is Admission Webhook? Its Place in the kube-apiserver Pipeline
In Kubernetes, an Admission Webhook is a dynamic HTTP(S) callback mechanism. When you run kubectl apply, create a Pod, or update an Ingress, the request does not go straight to etcd after authentication and authorization. It must pass through the kube-apiserver admission control pipeline, which consists of five sequential stages:
Authentication & Authorization : Verify identity and RBAC permissions.
Mutating Admission : Mutating webhooks and plugins can modify the object (e.g., Istio sidecar injection, default labels). Multiple mutating webhooks are called serially in configured order, with optional reinvocationPolicy: IfNeeded to re-check after later changes.
Object Schema Validation : API server re-validates the final object against OpenAPI schema to catch illegal fields introduced by mutating webhooks.
Validating Admission : Read-only validation webhooks run concurrently ; they cannot modify the object, only return allowed: true or allowed: false.
Persist to etcd : Only after all stages pass is the object written to etcd, triggering controller reconciliation.
The following diagram illustrates the five-stage pipeline, showing where mutating (blue) and validating (amber) webhooks intercept the request.
Figure 1: Kubernetes admission control five-stage pipeline. Mutating webhooks run before schema validation; validating webhooks run after.
A comparison table highlights key differences between Mutating and Validating webhooks across execution timing, modification capability, concurrency model, typical use cases, and primary risks.
Figure 2: Core differences between Mutating and Validating Admission Webhooks.
Two parameters in the webhook configuration directly affect pipeline behavior:
failurePolicy : Fail (default in v1) blocks the entire kubectl apply if the webhook is down, times out, or has an expired cert. Ignore lets the request through on failure, suitable only for non-critical side checks.
timeoutSeconds : Default 10 seconds (adjustable 1-30). Network policies that accidentally block callback traffic typically manifest as context deadline exceeded after the full timeout.
The protocol payload is a unified AdmissionReview JSON: API server POSTs operation type ( CREATE / UPDATE), user identity ( userInfo), and object versions ( object / oldObject). The webhook responds with an AdmissionResponse containing the allow/deny decision and optional JSONPatch for mutations.
What Was the ingress-nginx Webhook Originally Doing?
In typical Helm deployments, ingress-nginx registers a ValidatingWebhookConfiguration named ingress-nginx-admission pointing to the controller Pod's webhook Service (port 443, forwarded to container port 8443 ). Its sole purpose is a "syntax safety gate":
When an Ingress YAML is submitted, kube-apiserver sends an AdmissionReview via HTTPS to the controller's 8443 port.
The controller embeds the Ingress object and its annotations into an internal template, generating a temporary nginx.conf.
The controller runs nginx -t to perform a full syntax check on that temporary config.
If nginx -t fails, the webhook rejects the request and returns the error to kubectl; if it passes, the Ingress is allowed into etcd.
This prevents "configuration bombs" from reaching the live NGINX reload, which would otherwise take down all domains served by that controller.
From Syntax Gate to CVSS 9.8: How CVE-2025-1974 Happened
In March 2025, Wiz disclosed a set of critical vulnerabilities in community ingress-nginx collectively called IngressNightmare . The centerpiece, CVE-2025-1974 , scores CVSS 9.8 (Critical) and combines with annotation injection flaws (
CVE-2025-24514auth-url,
CVE-2025-1097auth-tls-match-cn,
CVE-2025-1098mirror-*) and a path traversal ( CVE-2025-24513). Affected versions: all below v1.11.5 and v1.12.0.
The exploit results from three simultaneous security assumption failures :
1. First Layer: Webhook Does Not Verify Caller Identity by Default
Kubernetes uses one-way TLS between API server and webhook: the API server validates the webhook's server certificate via the caBundle in the webhook config, but most webhook servers do not validate the caller's certificate or token to confirm it is the kube-apiserver . Although Kubernetes supports configuring the API server to present a client certificate (mTLS) or Bearer Token via --admission-control-config-file and a kubeConfigFile, managed clusters (EKS, GKE, AKS) control the control plane parameters, and the default ingress-nginx image/Chart does not enable caller authentication.
Consequence: Any workload Pod in the flat cluster network (or a mistakenly exposed ingress) can bypass kube-apiserver and RBAC entirely, directly POST a forged AdmissionReview JSON to the controller's 8443 port.
2. Second Layer: Annotation Injection + Client Body Buffer + nginx -t Loads Malicious Shared Library
With direct 8443 access, strict config parsing would only yield errors. However, affected ingress-nginx versions have multiple validation gaps when interpolating Ingress annotations (e.g., auth-url, auth-tls-match-cn, mirror-target) into the temporary nginx.conf, allowing arbitrary NGINX directive injection.
The RCE chain leverages OpenSSL's ssl_engine directive combined with NGINX request buffering:
Attacker sends an HTTP request to the controller's data plane port containing a compiled malicious shared library ( .so file), using a crafted Content-Length to keep the connection open, causing the library to remain in the NGINX client body buffer (an open file descriptor).
Attacker then POSTs a forged AdmissionReview to 8443, injecting ssl_engine /proc/<pid>/fd/<fd>; into the temporary nginx.conf and brute-forcing common PID/FD numbers.
When the controller runs nginx -t, the NGINX parser loads the dynamic library from the referenced file descriptor, executing attacker code as the controller process — with zero authentication.
3. Third Layer: High-Privilege ServiceAccount Escalates to Full Cluster Takeover
To read TLS secrets across namespaces, ingress-nginx typically receives a ClusterRole granting read access to all Secrets cluster-wide . Once RCE is achieved inside the controller Pod, the attacker can exfiltrate database passwords, API keys, cloud credentials, and high-privilege ServiceAccount tokens, turning a single 8443 request into full cluster compromise.
The following diagram maps the attack path and defense insertion points: legitimate API server calls (blue) pass through the isolation layer (green), while a compromised Pod (red) bypasses RBAC to hit 8443 directly; the amber dashed line shows where NetworkPolicy can block non-control-plane traffic, and the bottom illustrates the slide to full Secrets exposure if unblocked.
Figure 3: IngressNightmare attack chain and defense points. Compromised Pod bypasses RBAC to reach 8443, triggering nginx -t RCE; NetworkPolicy at ingress layer blocks non-control-plane access.
Practical Mitigation and Three High-Frequency Pitfalls
Defense follows three layers: patch the binary root cause, lock down the attack surface with network policy, and clarify long-term evolution. Two engineering details cause most production incidents.
1. Root Fix: Upgrade to Patched Versions and Plan Migration
Immediate upgrade to versions with fixed annotation injection and validation logic:
1.11 branch → v1.11.5 or later
1.12 branch → v1.12.1 or later
Note: Kubernetes SIG Network and the Security Response Committee announced in November 2025 that the community kubernetes/ingress-nginx controller is deprecated, with official maintenance and security updates ending March 2026 . The native Kubernetes Ingress API resource remains. Short term: patch and harden. Medium term: use the upgrade window to evaluate migration to Gateway API (or other actively maintained Ingress/Gateway controllers) to avoid running without patches.
2. Network Hardening: Lock Down 8443 with NetworkPolicy (Watch Business Ingress vs Control Plane Source)
Core idea: enforce an ingress allowlist on the controller's 8443 port, permitting only kube-apiserver traffic , completely cutting off lateral access from business Pods.
Example for self-managed clusters with known control plane CIDR (adjust for your CNI and control plane network):
# Example: modify with actual control plane CIDR and controller labels before applying
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: ingress-nginx-admission-lockdown
namespace: ingress-nginx
spec:
podSelector:
matchLabels:
app.kubernetes.io/component: controller
policyTypes:
- Ingress
ingress:
# 1. Explicitly allow business traffic ports (80/443) to avoid blocking normal site traffic when Ingress policy is enabled
- ports:
- protocol: TCP
port: 80
- protocol: TCP
port: 443
# 2. 8443 webhook port only from control plane source
- from:
- ipBlock:
cidr: 10.0.0.0/24 # replace with actual kube-apiserver control plane CIDR
ports:
- protocol: TCP
port: 8443Two common pitfalls when applying this policy:
Pitfall A: Managed cluster control plane is not in worker node kube-system . Many copy
namespaceSelector: { matchLabels: { kubernetes.io/metadata.name: kube-system } }. In kubeadm clusters this hits control plane Pods; in AWS EKS, GCP GKE, Azure AKS the API server runs in a separate cloud-managed VPC/network, not as worker Pods. Blindly using namespaceSelector blocks the real API server, causing all Ingress creates/updates to time out with context deadline exceeded. In managed environments, determine the actual control plane egress CIDR (e.g., GKE private cluster control plane /28, EKS private node scenario API server ENI subnet) or use a CNI like Cilium that supports control plane entities. Test in staging with kubectl apply before production. Also verify the CNI actually enforces NetworkPolicy (e.g., Flannel default mode does not).
Pitfall B: Forgetting to allow 80/443 business ports . Once policyTypes: [Ingress] is declared, any port not explicitly allowed in an ingress rule becomes default-deny. A policy that only whitelists 8443 but omits 80, 443, and metrics ports (e.g., 10254) will instantly cut off all external user traffic and monitoring.
3. Emergency Disable Pitfall: Deleting ValidatingWebhookConfiguration Does Not Stop 8443 Listener
If a legacy cluster cannot upgrade immediately and the CNI lacks NetworkPolicy support, the official temporary mitigation is disabling the Admission Webhook. However, many only run:
# WARNING: This alone is NOT sufficient!
kubectl delete ValidatingWebhookConfiguration ingress-nginx-admissionThis only stops the kube-apiserver from actively calling the webhook. The controller container still listens on 8443 if its startup arguments include --validating-webhook=:8443. Attackers inside the cluster can still connect directly and trigger RCE.
To truly close the listening port, you must also disable the controller-side webhook parameter and restart the Pod. With Helm:
# Example: disable Admission Webhook via Helm and trigger controller config update
helm upgrade ingress-nginx ingress-nginx/ingress-nginx \
--namespace ingress-nginx \
--reuse-values \
--set controller.admissionWebhooks.enabled=falseFor static YAML deployments, remove --validating-webhook arguments from the Deployment/DaemonSet container args and wait for Pod recreation, then verify 8443 is no longer listening. After patching, re-enable the webhook to restore Ingress syntax pre-check capability.
4. Architectural Reflection: When Should You Not Write a Webhook?
Much of the operational burden from CVE-2025-1974 stems from needing a persistent HTTPS service. Since Kubernetes v1.30 , the built-in ValidatingAdmissionPolicy (CEL expression language) has reached GA. For most field format validation, forbidden annotations, mandatory TLS, or domain wildcard restrictions, rules can be evaluated in-process by the kube-apiserver using CEL:
No extra network hops or certificate rotation issues.
No additional 8443 port exposed in the Pod network waiting to be scanned.
No risk of external webhook Pod restarts locking the entire cluster's mutation channel.
Only when you truly need "dynamic object mutation (e.g., sidecar injection)" or "call external systems for complex logic (e.g., run nginx -t for full config generation validation)" does the complexity and security boundary cost of an external Admission Webhook become justified.
Production Rollout and Audit Checklist
If you are responsible for cluster hardening or maintaining ingress-nginx, verify these five steps in order:
Check versions and exposure : Confirm all ingress-nginx instances are upgraded to v1.11.5+ or v1.12.1+, and ensure no Ingress or LoadBalancer Service accidentally exposes 8443 to the public internet or untrusted networks.
Validate network isolation effectiveness : Verify the cluster CNI supports and has NetworkPolicy enabled, that policies precisely restrict 8443 ingress sources, that 80, 443, and monitoring ports remain allowed, and test an Ingress create/update after changes to confirm the control plane is not mistakenly blocked.
Confirm emergency disable is complete : If using temporary webhook shutdown, check that controller container startup arguments have removed --validating-webhook (not just deleted ValidatingWebhookConfiguration), and verify 8443 is no longer listening.
Inventory cluster-wide webhook risks : Run
kubectl get validatingwebhookconfigurations,mutatingwebhookconfigurationsto list all third-party webhooks. Audit failurePolicy (avoid core components misconfigured as Fail causing cascading failures) and Service port exposure scope.
Plan long-term replacement : Add "replace lightweight compliance webhooks with ValidatingAdmissionPolicy (CEL)" and "migrate ingress-nginx to Gateway API or actively maintained controllers" to the next platform evolution roadmap.
For questions about attribution, corrections or content rights, please contactand we will review it promptly.