id: CVE-2025-1974-k8s info: name: Ingress-Nginx Controller - Unauthenticated Remote Code Execution author: princechaddha severity: critical description: A security issue was discovered in ingress-nginx where the `auth-tls-match-cn` Ingress annotation can be used to inject configuration into nginx. This can lead to arbitrary code execution in the context of the ingress-nginx controller, and disclosure of Secrets accessible to the controller impact: | Vulnerable versions of Ingress-Nginx controller can be exploited to gain unauthorized access to all secrets across namespaces in the Kubernetes cluster, potentially leading to complete cluster takeover. remediation: | Update to one of the following versions: Version 1.12.1 or later / Version 1.11.5 or later reference: - https://www.wiz.io/blog/ingress-nginx-kubernetes-vulnerabilities - https://projectdiscovery.io/blog/ingressnightmare-unauth-rce-in-ingress-nginx tags: cve,cve2025,cloud,devops,kubernetes,ingress,nginx,k8s,k8s-cluster-security,vkev flow: | code(1); for (let pod of template.items) { set("pod", pod) javascript(1); } self-contained: true code: - engine: - sh - bash source: kubectl get pods -n ingress-nginx -l app.kubernetes.io/component=controller -o json extractors: - type: json name: items internal: true json: - '.items[]' javascript: - code: | let podData = JSON.parse(template.pod); const container = podData.spec.containers.find(c => c.name === 'controller'); if (container && container.image) { const imageTag = container.image.split(':')[1]; if (imageTag) { const version = imageTag.split('@')[0].replace(/^v/, ''); const [major, minor, patch] = version.split('.').map(v => parseInt(v, 10)); if ((major === 1 && minor === 11 && patch < 5) || (major === 1 && minor === 12 && patch === 0) || (major === 1 && minor < 11) || (major === 1 && minor === 9 && patch <= 3)) { let result = (`Ingress-Nginx controller in namespace '${podData.metadata.namespace}' is running vulnerable version ${version}. Update to v1.12.1+ or v1.11.5+`); Export(result); } } } extractors: - type: dsl dsl: - response # digest: 4b0a00483046022100a16749044616d7fa5bef0f34b7dc0efffcd6e15a1e913779e4d7ea7e5ae880ec0221008c99c79bb10af571f216473a6b882121d5a73ea2dd9924fac43efc9c2ba1c61b:922c64590222798bb761d5b6d8e72950