Skip to content

SnailSploit/CVE-2026-3288

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

CVE-2026-3288: ingress-nginx Configuration Injection via rewrite-target Annotation

CVE CVSS Score Kubernetes CWE-20 Advisory

Keywords: CVE-2026-3288, ingress-nginx vulnerability, Kubernetes security, nginx configuration injection, rewrite-target annotation, RCE, Secret disclosure, CWE-20, CAPEC-176, ingress-nginx CVE 2026, Kubernetes cluster compromise

Table of Contents

Overview

A security issue was discovered in ingress-nginx where the nginx.ingress.kubernetes.io/rewrite-target 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. (Note that in the default installation, the controller can access all Secrets cluster-wide.)

Discovered by: Kai Aizen
Published: March 9, 2026
CVSS Score: 8.8 (High)
CWE: CWE-20 — Improper Input Validation
CAPEC: CAPEC-176 — Configuration/Environment Manipulation
Component: ingress-nginx
Attack Type: Nginx Configuration Injection via Ingress Annotation
Required Privileges: Low (PR:L)

Vulnerability Details

Description

The nginx.ingress.kubernetes.io/rewrite-target Ingress annotation is intended to modify the request path before it is forwarded to upstream services. However, the implementation allows injection of arbitrary configuration directives directly into the underlying nginx configuration.

An attacker with the ability to create or modify Ingress resources can leverage this to:

  • Execute arbitrary code in the context of the ingress-nginx controller
  • Read Secrets accessible to the controller
  • In the default installation, access all Secrets cluster-wide

Impact

Impact Area Severity
Confidentiality High — Full Secret disclosure (cluster-wide in default config)
Integrity High — Arbitrary code execution in controller context
Availability High — Full compromise of ingress-nginx controller

Root Cause

The core issue is that ingress-nginx processes the rewrite-target annotation value without sufficient input validation, allowing attacker-controlled content to be written directly into the nginx configuration. This is a configuration injection vulnerability — the annotation value is trusted as a simple rewrite path but can contain arbitrary nginx directives.

Technical Analysis

Attack Surface

The vulnerability is reachable by any user with permissions to create or modify Ingress resources in a cluster running ingress-nginx. The attack requires:

  1. Ability to create/modify an Ingress resource
  2. The ingress-nginx controller must be running
  3. No additional user interaction required

Ingress-nginx Annotation Injection History

This vulnerability belongs to a well-established class of annotation injection bugs in ingress-nginx:

CVE Year Annotation Impact
CVE-2021-25746 2022 Various annotations Directive injection
CVE-2023-5044 2023 permanent-redirect Code injection
CVE-2024-7646 2024 Annotation validation bypass Validation bypass
CVE-2026-3288 2026 rewrite-target RCE + Secret disclosure

The recurring pattern: annotation values flow into nginx configuration without adequate sanitization. Different annotations, same root cause.

Affected Versions

Branch Vulnerable Fixed
1.13.x < 1.13.8 1.13.8
1.14.x < 1.14.4 1.14.4
1.15.x < 1.15.0 1.15.0

Check If You're Affected

# Check if ingress-nginx is installed
kubectl get pods --all-namespaces --selector app.kubernetes.io/name=ingress-nginx

# Check ingress-nginx version
kubectl exec -n ingress-nginx \
  $(kubectl get pods -n ingress-nginx -l app.kubernetes.io/name=ingress-nginx -o jsonpath='{.items[0].metadata.name}') \
  -- /nginx-ingress-controller --version

If you do not have ingress-nginx installed on your cluster, you are not affected.

Remediation

Upgrade (Recommended)

Upgrade ingress-nginx to the patched version for your branch:

# Using Helm
helm upgrade ingress-nginx ingress-nginx/ingress-nginx \
  --namespace ingress-nginx \
  --version <patched-chart-version>

Refer to the official upgrade documentation: Upgrading Ingress-nginx

Mitigation (If Upgrade Is Not Immediately Possible)

Use admission control to block the use of the rewrite-target annotation until you can upgrade:

apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
  name: block-rewrite-target
webhooks:
  - name: block-rewrite-target.security.local
    rules:
      - apiGroups: ["networking.k8s.io"]
        apiVersions: ["v1"]
        operations: ["CREATE", "UPDATE"]
        resources: ["ingresses"]
    clientConfig:
      # Point to a webhook service that rejects Ingress resources
      # containing the rewrite-target annotation

Detection

Suspicious data within the rules.http.paths.path field of an Ingress resource could indicate an attempt to exploit this vulnerability.

# Check for suspicious Ingress annotations
kubectl get ingress --all-namespaces -o json | \
  jq '.items[] | select(.metadata.annotations["nginx.ingress.kubernetes.io/rewrite-target"] != null) | {namespace: .metadata.namespace, name: .metadata.name, rewrite: .metadata.annotations["nginx.ingress.kubernetes.io/rewrite-target"]}'

If you find evidence that this vulnerability has been exploited, contact security@kubernetes.io.

CVSS v3.1 Metrics

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Metric Value
Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

Timeline

Date Event
Vulnerability discovered and reported to Kubernetes Security Response Committee
March 9, 2026 Security advisory published
March 9, 2026 Patched versions released (1.13.8, 1.14.4, 1.15.0)
March 9, 2026 CVE-2026-3288 assigned

References

Credits

Researcher: Kai Aizen — SnailSploit

Acknowledgement: Tabitha Sable on behalf of the Kubernetes Security Response Committee

Disclaimer

This information is provided for security research and defensive purposes only. Any exploitation of this vulnerability for malicious purposes is illegal and unethical. Always obtain proper authorization before testing systems you do not own.

Contact

For questions or additional information about this vulnerability:


Last updated: March 10, 2026

About

Walkthrough: ingress-nginx Configuration Injection via rewrite-target Annotation

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages