A series of remote code execution (RCE) vulnerabilities known as “IngressNightmare” have been discovered in the Ingress NGINX Controller for Kubernetes.
These vulnerabilities, identified as CVE-2025-1097, CVE-2025-1098, CVE-2025-24514, and CVE-2025-1974, pose a critical threat to Kubernetes clusters, allowing attackers to gain unauthorized access to all cluster secrets and potentially take control of the entire cluster.
The CVE-2025-24514 vulnerability arises from the handling of authentication-related annotations, specifically the nginx.ingress.kubernetes.io/auth-url annotation.
In the authReq parser, the auth-url field is not properly sanitized when it is incorporated into the NGINX configuration.
This oversight allows attackers to inject arbitrary NGINX directives by crafting malicious annotations.
For instance, if an attacker uses the following annotation:
nginx.ingress.kubernetes.io/auth-url: "http://example.com/#;\ninjection_point"
The resulting NGINX configuration could appear as:
proxy_http_version 1.1;
set $target http://example.com/#;
injection_point
proxy_pass $target;
This vulnerability is particularly dangerous because it allows attackers to inject commands into the NGINX configuration, potentially leading to remote code execution.
According to the Wiz reports,CVE-2025-1097 involves the nginx.ingress.kubernetes.io/auth-tls-match-cn annotation, which requires a value starting with “CN=” and followed by a valid regular expression.
However, attackers can bypass these checks to inject arbitrary configurations. For example, using the annotation:
nginx.ingress.kubernetes.io/auth-tls-match-cn: "CN=abc #(\n){}\n }}\nglobal_injection;\n#"
can lead to injection of arbitrary NGINX directives into the configuration file.
To exploit this, attackers need access to a TLS certificate or keypair secret in the cluster, which is often readily available in managed environments. Commonly exploited secrets include:
kube-system/konnectivity-certs
kube-system/azure-wi-webhook-server-cert
kube-system/aws-load-balancer-webhook-tls
kube-system/hubble-server-certs
kube-system/cilium-ca
calico-system/node-certs
cert-manager/cert-manager-webhook-ca
linkerd/linkerd-policy-validator-k8s-tls
linkerd/linkerd-proxy-injector-k8s-tls
linkerd/linkerd-sp-validator-k8s-tls
In this vulnerability, the mirror annotation parser allows attackers to inject arbitrary directives by manipulating the UID field of the ingress object.
Since this input is not sanitized by regex rules applied to annotations, attackers can easily escape the intended context and inject arbitrary NGINX configurations.
While the previous vulnerabilities allow for configuration injection, CVE-2025-1974 demonstrates how these injections can be leveraged for remote code execution.
By exploiting the ssl_engine directive within the injected configurations, attackers can load arbitrary shared libraries from the filesystem.
This is achieved by using NGINX’s client body buffering feature to temporarily save a shared library onto the pod’s filesystem and then specifying its ProcFS path to load it as a library.
Exploitation Steps
The exploitation involves the following key steps:
To mitigate these vulnerabilities, users should:
As these vulnerabilities expose clusters to significant risk, immediate action is advised to secure Ingress NGINX Controllers and prevent potential takeovers.
The security community encourages ongoing vigilance regarding admission controllers, often overlooked but critical components in Kubernetes environments.
Investigate Real-World Malicious Links & Phishing Attacks With Threat Intelligence Lookup - Try for Free
Kuala Lumpur International Airport (KLIA), one of Southeast Asia's busiest airports, was hit by a…
The Tor Project has swiftly released an emergency update for the Tor Browser, 14.0.8, which…
Resecurity, a prominent cybersecurity firm, has successfully exploited a vulnerability in the Data Leak Site…
Classiscam, an automated scam-as-a-service operation, has been identified as a significant threat in Central Asia,…
INE, a global leader in networking and cybersecurity training and certifications, is proud to announce…
A large-scale cyberattack has compromised approximately 150,000 legitimate websites by injecting malicious JavaScript to redirect…