CVE-2025-1097

8.8 HIGH

📋 TL;DR

CVE-2025-1097 is a critical vulnerability in ingress-nginx where the auth-tls-match-cn annotation can be exploited to inject malicious configuration into nginx, potentially leading to arbitrary code execution and disclosure of Kubernetes Secrets. This affects all Kubernetes clusters using ingress-nginx with TLS client certificate authentication enabled. The controller's default cluster-wide Secret access makes this particularly dangerous.

💻 Affected Systems

Products:
  • kubernetes/ingress-nginx
Versions: All versions before the fix
Operating Systems: All platforms running ingress-nginx
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when using TLS client certificate authentication with the auth-tls-match-cn annotation. Default installations without this feature are not affected.

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full cluster compromise: attacker gains code execution on ingress controller pod, accesses all cluster Secrets, pivots to other workloads, and potentially takes over the entire Kubernetes cluster.

🟠

Likely Case

Secret disclosure and limited code execution: attacker extracts sensitive credentials from Secrets, potentially compromising applications and services that rely on those credentials.

🟢

If Mitigated

Limited impact if proper network policies, RBAC restrictions, and namespace segregation prevent lateral movement and Secret access.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires ability to create or modify Ingress resources with the vulnerable annotation. Public exploit code exists on Exploit-DB.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Check latest ingress-nginx releases after March 2025

Vendor Advisory: https://github.com/kubernetes/ingress-nginx/security/advisories

Restart Required: Yes

Instructions:

1. Update ingress-nginx controller to patched version. 2. Delete and recreate controller pods to ensure new version is running. 3. Verify annotation validation is now enforced.

🔧 Temporary Workarounds

Disable vulnerable annotation

all

Remove or restrict use of auth-tls-match-cn annotation in Ingress resources

kubectl get ingress --all-namespaces -o yaml | grep -i 'auth-tls-match-cn'
kubectl edit ingress <name> -n <namespace> # Remove the annotation

Restrict Ingress creation

all

Use Kubernetes RBAC to limit who can create/modify Ingress resources

kubectl create role ingress-restricted --verb=get,list --resource=ingresses
kubectl create rolebinding restrict-ingress --role=ingress-restricted --user=<username>

🧯 If You Can't Patch

  • Implement strict RBAC controls to prevent unauthorized Ingress modifications
  • Deploy network policies to isolate ingress-nginx controller and limit Secret access

🔍 How to Verify

Check if Vulnerable:

Check if any Ingress resources use auth-tls-match-cn annotation: kubectl get ingress --all-namespaces -o jsonpath='{.items[*].metadata.annotations.auth-tls-match-cn}'

Check Version:

kubectl describe pod -n ingress-nginx | grep Image

Verify Fix Applied:

Verify ingress-nginx controller version is patched and annotation validation rejects malicious values

📡 Detection & Monitoring

Log Indicators:

  • Unusual nginx configuration changes
  • Unexpected Secret access attempts from ingress controller
  • Malformed annotation values in Ingress resources

Network Indicators:

  • Unexpected outbound connections from ingress controller pods
  • Anomalous traffic patterns to Secret API endpoints

SIEM Query:

source="kubernetes" AND ("auth-tls-match-cn" OR "ingress-nginx" AND "annotation")

🔗 References

📤 Share & Export