Severity:

HIGH RISK

(8.8)

Improper Input Validation in ingress-nginx Auth Method

CVE-2026-1580

Awaiting Analysis

Vulnerability type

Category:

Improper Input Validation

CWE:

CWE-20

Impact:

Remote Code Execution and Secret Disclosure

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Ingress-nginx incorrectly trusts the nginx.ingress.kubernetes.io/auth-method annotation, allowing crafted values to inject configuration into the underlying nginx process.

In clusters where attackers can create or modify Ingress objects, this misvalidation can lead to arbitrary code execution in the ingress-nginx controller and exposure of Kubernetes Secrets accessible to that controller.

Affected context

The vulnerability affects Kubernetes clusters using ingress-nginx where:

  • The controller processes user-controlled Ingress resources
  • The nginx.ingress.kubernetes.io/auth-method annotation is honored to configure authentication behavior
  • Ingress objects may be created or updated by less-trusted tenants, namespaces, or automation

In typical default setups, the ingress-nginx controller has broad or cluster-wide access to Kubernetes Secrets, increasing the blast radius of a compromise.

Exploit preconditions

  • Attack surface: Kubernetes API surface exposed to parties who can create or modify Ingress resources.
  • Required access: Ability to define or update an Ingress with a controlled nginx.ingress.kubernetes.io/auth-method annotation in a namespace managed by the affected ingress-nginx controller.
  • Trigger point: Reconciliation and reload of nginx configuration by the ingress-nginx controller after processing the malicious annotation.
  • Why exploitation is possible: The annotation value is not sufficiently validated or constrained before being translated into nginx configuration, allowing configuration injection and eventual code execution in the controller context.

Why this happens

The root cause is improper input validation (CWE-20) in how ingress-nginx interprets the nginx.ingress.kubernetes.io/auth-method annotation and transforms it into nginx configuration directives.

Instead of treating annotation values as untrusted data with strict, enumerated options or robust syntax checking, the controller effectively passes user-supplied values into the nginx configuration layer.

This configuration-injection pathway breaks the intended abstraction between Kubernetes API objects and the underlying web server, enabling attackers to smuggle directives that can be abused to execute code or access sensitive resources.

Potential impact

  • Execution of arbitrary code within the ingress-nginx controller Pod.
  • Theft or exposure of Kubernetes Secrets that the controller is permitted to read, potentially cluster-wide.
  • Unauthorized access to TLS private keys and credentials used by Ingress resources.
  • Lateral movement from the ingress-nginx controller into other workloads or cluster components.
  • Service disruption through manipulated nginx configuration leading to outages or traffic hijacking.

General mitigation guidance

Mitigation generally focuses on tightening trust boundaries around annotations and reducing controller blast radius:

  • Constrain Ingress annotations to a safe, finite set of values for fields like auth-method, using strict schema validation and defensive parsing.
  • Treat all annotation content as untrusted input and avoid directly mapping arbitrary strings into server configuration directives.
  • Apply least-privilege principles to the ingress-nginx controller ServiceAccount, granting only the Secrets and resources it strictly needs.
  • Segregate high-risk, multi-tenant namespaces behind dedicated ingress controllers with reduced privileges to limit cross-tenant impact.
  • Use admission controls or policy engines to enforce annotation allowlists and to block unsafe or unknown annotation patterns.

How teams detect issues like this

Effective detection usually combines configuration analysis, runtime monitoring, and policy enforcement:

  • Use policy engines (e.g., admission controllers, OPA/Gatekeeper, Kyverno) to flag or block Ingress resources containing non-approved or unusual auth-method values.
  • Employ static configuration scanning of cluster manifests and Git repositories to identify risky ingress-nginx annotations and configuration-injection patterns.
  • Monitor ingress-nginx controller logs and nginx error logs for unexpected configuration reloads, syntax anomalies, or directives that fall outside standard templates.
  • Regularly review RBAC bindings and Secret access patterns for the controller's ServiceAccount to detect over-privileged configurations.
  • Integrate automated security review tools into CI/CD pipelines to highlight unsafe usage of powerful annotations before deployment.

Sources

SourceLink
github.comgithub.com/kubernetes/kubernetes/issues/136677

Frequently asked

questions

Indirectly. An external attacker typically needs a way to influence or create Ingress resources (for example, via a compromised application, CI/CD pipeline, or misconfigured RBAC). Once they can control Ingress annotations, they can attempt to exploit the controller without direct network access to it.

An attacker generally needs permissions to create or modify Ingress objects in a namespace handled by the vulnerable ingress-nginx controller. In many clusters, this may be granted to application teams, tenants, or automated deployment systems.

The safest pattern is to strictly validate and constrain any user-driven configuration fields—such as annotations—to well-defined, enumerated options, and to avoid converting free-form strings into low-level server directives or scriptable contexts.

Design ingress and controller extensions with a clear separation between high-level API fields and underlying server configuration. Apply defensive parsing, annotation allowlists, strong admission policies, and least-privilege RBAC for controllers so that even if a configuration path is abused, the blast radius remains limited.

Find out what's already
exploitable in your codebase.