/

CVE-2026-24512

Severity:

HIGH RISK

(8.8)

Improper Input Validation in ingress-nginx Ingress Path

CVE-2026-24512

Awaiting Analysis

Vulnerability type

Category:

Improper Input Validation

CWE:

CWE-20

Impact:

Remote Code Execution and Sensitive Data Exposure

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

An improper input validation issue in ingress-nginx allows the rules.http.paths.path Ingress field to inject attacker-controlled configuration into the underlying NGINX configuration.

When exploited, this can lead to arbitrary code execution in the context of the ingress-nginx controller and exposure of Kubernetes Secrets accessible to that controller, including in default setups where it can reach Secrets cluster-wide.

Affected context

The issue affects Kubernetes clusters using ingress-nginx where Ingress resources are translated into NGINX configuration.

It is most relevant in environments where:

  • Users or services can create or modify Ingress objects,
  • The NGINX configuration generated from Ingress fields is not strictly sanitized or bounded,
  • The ingress-nginx controller has broad access to Secrets (such as default cluster-wide access).

Under these conditions, manipulating the rules.http.paths.path field can influence the generated NGINX configuration in unsafe ways.

Exploit preconditions

  • Attack surface: Kubernetes API via Ingress resources processed by ingress-nginx.
  • Required access: Ability to create or update Ingress objects in a namespace handled by the ingress-nginx controller (e.g., developer, application service account, or compromised workload with sufficient RBAC).
  • Trigger point: The ingress-nginx controller reconciles the modified Ingress and regenerates the NGINX configuration, causing the injected directives to be applied.
  • Why exploitation is possible: The rules.http.paths.path field is treated as a largely trusted value and incorporated into NGINX configuration without sufficient validation or strict encoding, enabling configuration injection that can be leveraged to execute code or access sensitive data.

Why this happens

The underlying problem is improper input validation and contextual encoding of user-controlled configuration data mapped from Kubernetes Ingress objects to NGINX configuration.

The rules.http.paths.path field, which should represent a constrained HTTP path, is effectively treated as a free-form string and embedded into the generated NGINX configuration.

Because ingress-nginx does not adequately sanitize or restrict this field to a safe subset of characters and patterns, attackers can craft values that break out of the intended context and inject additional NGINX directives.

This aligns with CWE-20: Improper Input Validation, where the software fails to validate inputs against expected format, type, or range, allowing malformed or malicious values to alter program behavior.

Potential impact

  • Execution of arbitrary commands or code in the context of the ingress-nginx controller.
  • Reading or exfiltration of Kubernetes Secrets that the controller can access, potentially cluster-wide.
  • Lateral movement within the cluster by abusing credentials or tokens exposed through the controller.
  • Tampering with traffic routing, leading to request interception, redirection, or denial of service.
  • Expansion of an initial compromise of a single namespace or service account into broader cluster compromise.

General mitigation guidance

Effective mitigation focuses on constraining input, hardening configuration generation, and limiting blast radius:

  • Enforce strict validation on the rules.http.paths.path field so it only accepts well-formed HTTP paths (e.g., disallow control characters, NGINX directive syntax, and unsafe metacharacters).
  • Treat Ingress-derived values as untrusted and ensure they are safely encoded or quoted before inclusion in template-generated NGINX configuration.
  • Apply defense-in-depth RBAC so that only trusted principals can create or modify Ingress resources, and restrict which namespaces or tenants share a controller.
  • Reduce the privileges of the ingress-nginx controller by limiting its access to Secrets and other sensitive resources to only what is strictly necessary for TLS and basic operation.
  • Use policy engines (such as admission control or configuration policies) to block Ingress objects with suspicious path patterns or disallowed characters.

How teams detect issues like this

Detection commonly involves configuration analysis, policy enforcement, and behavioral monitoring:

  • Use static or policy-based analysis (e.g., admission webhooks, OPA/Gatekeeper, Kyverno) to inspect Ingress definitions and reject paths that deviate from expected patterns.
  • Perform code or template reviews of ingress-nginx configuration generation logic, looking for places where user-controlled fields are inserted into NGINX configuration without stringent validation or encoding.
  • Monitor ingress-nginx logs and controller events for unusual configuration reloads, unexpected errors, or atypical directives appearing in rendered NGINX configs.
  • Periodically scan the running NGINX configuration within ingress-nginx pods for injected or unrecognized directives that could indicate abuse.
  • Integrate automated cluster security tools that flag over-privileged controllers and anomalous access to Secrets correlated with Ingress changes.

Sources

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

Frequently asked

questions

It is indirectly remote: an attacker must be able to create or modify Ingress resources exposed via the Kubernetes API. In multi-tenant or misconfigured clusters where external users can influence Ingress definitions, this can effectively become a remote attack vector.

The attacker needs permissions to create or update Ingress resources that are processed by the affected ingress-nginx controller. This might be a developer account, a compromised application service account, or any identity with suitable RBAC permissions in the relevant namespaces.

The safest pattern is to strictly validate and constrain the Ingress path field to a narrow, well-defined format and to ensure that all user-controlled values are properly encoded before being written into NGINX configuration. Additionally, harden the controller by reducing its access to Secrets and other sensitive resources.

Adopt a secure-by-design approach for configuration translation layers: treat all user-supplied configuration as untrusted, apply rigorous input validation and contextual encoding, enforce RBAC and admission policies around high-impact objects like Ingress, and conduct regular security reviews of controller templates and privileges.

Find out what's already
exploitable in your codebase.