Ingress-NGINX — 1 vulnerability check

noctis ships 1 vulnerability check for Ingress-NGINX, covering 1 CVE; each one has to observe the bug on the live service before it reports a finding.

← All products · Feeds on GitHub

Ingress-NGINX Admission Webhook load_module Config Injection

CVECVE-2025-1974
Severitycritical · CVSS 9.8
Categoryrce — Remote code execution
Serviceshttp, https
Detectionhttp_request, match · highest QoD 97
Feedtests/vulnerabilities/ingress-nginx/CVE-2025-1974.yaml

Tests Ingress-NGINX Controller for unauthenticated NGINX configuration injection via the ValidatingWebhookConfiguration admission webhook. The webhook processes arbitrary Kubernetes AdmissionReview objects and passes the metadata.uid field unsanitised into the generated nginx.conf. An attacker can inject a load_module directive (with trailing newlines to break out of the uid context) and get the NGINX worker to load an arbitrary shared library, achieving remote code execution with access to all Kubernetes secrets. Disclosed by Wiz Research (IngressNightmare, March 2025). Detection: POST an AdmissionReview with load_module in the uid field. Vulnerable controllers return an NGINX config error message confirming the directive was parsed (QoD 97).

How noctis detects it

  1. HTTP(S) request POST / with a crafted body
  2. Checks webhook_resp.body for directive is specified too late → finding QoD 97: Ingress-NGINX admission webhook reflects NGINX config parse error for injected load_module directive — uid field is not sanitised before in…

References:

Feed source — tests/vulnerabilities/ingress-nginx/CVE-2025-1974.yaml
uid: c5f2a8d1-7e4b-4093-b6f1-3a9e0c1d8b5f
name: "Ingress-NGINX Admission Webhook load_module Config Injection (CVE-2025-1974)"
description: |
  Tests Ingress-NGINX Controller for unauthenticated NGINX configuration
  injection via the ValidatingWebhookConfiguration admission webhook. The
  webhook processes arbitrary Kubernetes AdmissionReview objects and passes
  the metadata.uid field unsanitised into the generated nginx.conf. An
  attacker can inject a load_module directive (with trailing newlines to break
  out of the uid context) and get the NGINX worker to load an arbitrary shared
  library, achieving remote code execution with access to all Kubernetes
  secrets. Disclosed by Wiz Research (IngressNightmare, March 2025).
  Detection: POST an AdmissionReview with load_module in the uid field.
  Vulnerable controllers return an NGINX config error message confirming the
  directive was parsed (QoD 97).
cves: [CVE-2025-1974]
cvss: 9.8
severity: critical
category: rce
confidence_base: 0.20
tags: [ingress-nginx, kubernetes, rce, config-injection, webhook]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2025-1974"
  - "https://www.wiz.io/blog/ingress-nginx-kubernetes-vulnerabilities"
  - "https://projectdiscovery.io/blog/ingressnightmare-unauth-rce-in-ingress-nginx"
  - "https://github.com/hakaioffsec/IngressNightmare-PoC"

steps:
  # POST an AdmissionReview with a load_module directive injected into
  # metadata.uid via JSON string escape sequences (\n breaks out of the NGINX
  # uid context into a bare nginx.conf scope). Vulnerable controllers echo the
  # raw NGINX parse error in the response; patched controllers sanitise uid
  # and return a generic rejection without the nginx error string.
  - id: webhook-probe
    action: http_request
    method: POST
    path: /
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    headers:
      Content-Type: "application/json"
    body: |
      {"kind":"AdmissionReview","apiVersion":"admission.k8s.io/v1","request":{"uid":"{{oob_token}}","name":"noctis-probe","namespace":"default","operation":"CREATE","dryRun":true,"userInfo":{"username":"noctis"},"object":{"kind":"Ingress","apiVersion":"networking.k8s.io/v1","metadata":{"name":"noctis-probe","namespace":"default","uid":"InjectTest#;\n}\nload_module /tmp/noctis.so;"},"spec":{"ingressClassName":"nginx","rules":[{"host":"test.example.com","http":{"paths":[{"path":"/","pathType":"Prefix","backend":{"service":{"name":"test","port":{"number":80}}}}]}}]},"status":{}}}}
    store_as: webhook_resp

  - id: webhook-match
    action: match
    source: webhook_resp.body
    pattern: "directive is specified too late"
    on_match:
      finding:
        confidence_delta: 0.70
        qod: 97
        evidence: "Ingress-NGINX admission webhook reflects NGINX config parse error for injected load_module directive — uid field is not sanitised before inclusion in nginx.conf"

View these feeds on GitHub