{
  "hunt": {
    "meta": {
      "tlp": "clear",
      "hunt": {
        "handoff": "keep-as-periodic-hunt",
        "trigger": "intel-report",
        "methodology": "model-assisted",
        "applicability": "campaign-specific",
        "justification": "CVE-2026-114938 is a critical unauthenticated RCE vulnerability in the JVM. Given the prevalence of Java in enterprise environments, a proactive hunt to identify both exposure and potential exploitation is required until patching is complete."
      },
      "name": "Java4Shell (CVE-2026-114938) Exploitation and Exposure",
      "type": "investigation",
      "labels": [
        "hunt",
        "attack.t1190",
        "execution",
        "impact",
        "initial access"
      ],
      "related": [
        {
          "hunt": "log4shell-post-exploitation",
          "reason": "Log4Shell also targets Java but via a JNDI mechanism; the follow-on shell activity is similar.",
          "relation": "alternative"
        }
      ],
      "targets": {
        "hunter": {
          "name": "Hunt agent",
          "agent": true
        },
        "analyst": {
          "name": "Tier-2 analyst",
          "role": "analyst"
        },
        "endpoint": {
          "name": "Endpoint telemetry (hb_ surfaces)",
          "category": "endpoint",
          "telemetry": [
            "endpoint"
          ]
        }
      },
      "analysis": "A static detection rule for 'java spawning a shell' may be too noisy in environments with developers. This hunt adds context by filtering for vulnerable versions, identifying rare runtime paths, and correlating with JVM-specific memory corruption errors, providing the analyst with a clearer picture of actual compromise.",
      "coverage": [
        {
          "stage": "java4shell-vulnerability-exposure",
          "steps": [
            "identify-vulnerable-java",
            "rare-java-execution"
          ],
          "status": "covered"
        },
        {
          "stage": "base64-exploitation-traffic",
          "reason": "The hb_http_activity surface does not provide the HTTP request body logging required to inspect Base64 payloads for malicious content.",
          "status": "not_visible",
          "blind_spot": "base64-payload-visibility"
        },
        {
          "stage": "jvm-process-crash",
          "steps": [
            "jvm-hotspot-crashes"
          ],
          "status": "covered"
        },
        {
          "stage": "post-exploitation-java-activity",
          "steps": [
            "java-spawning-shells"
          ],
          "status": "covered"
        }
      ],
      "scenario": {
        "stages": [
          {
            "name": "Java4Shell Vulnerability Exposure",
            "slug": "java4shell-vulnerability-exposure",
            "tactic": "initial-access",
            "techniques": [
              "T1190"
            ],
            "observables": [
              "Oracle Java SE: 8u511b33-perf",
              "Oracle Java SE: 17.0.21.0.3",
              "Oracle Java SE: 21.0.13.0.3",
              "Oracle Java SE: 25.0.5.0.3",
              "Oracle Java SE: 27.0.1.0.3",
              "GraalVM for JDK: 17.0.21.0.3",
              "GraalVM for JDK: 21.0.13.0.3",
              "CVE-2026-114938"
            ]
          },
          {
            "name": "Base64 Exploitation Traffic",
            "slug": "base64-exploitation-traffic",
            "tactic": "initial-access",
            "techniques": [
              "T1190"
            ],
            "observables": [
              "Specially crafted Base64 input in HTTP requests",
              "Large Base64 strings targeting JVM HotSpot decoder"
            ]
          },
          {
            "name": "JVM Process Crash",
            "slug": "jvm-process-crash",
            "tactic": "impact",
            "observables": [
              "Unexpected JVM crashes",
              "Application Error in java.exe",
              "Faulting module: HotSpot JVM",
              "Memory corruption exception codes"
            ]
          },
          {
            "name": "Post-Exploitation Java Activity",
            "slug": "post-exploitation-java-activity",
            "tactic": "execution",
            "techniques": [
              "T1190"
            ],
            "observables": [
              "Suspicious Java processes",
              "Rogue runtimes",
              "java.exe spawning cmd.exe or /bin/sh",
              "Anomalous child processes of Java applications"
            ]
          }
        ],
        "summary": "Attackers can achieve unauthenticated remote code execution by exploiting a memory-corruption vulnerability in the Oracle Java Base64 decoder (CVE-2026-114938). Successful exploitation typically triggers a JVM crash followed by the execution of rogue runtimes or suspicious child processes under the Java application process."
      },
      "severity": "high",
      "rationale": "Start by identifying internet-facing servers running Java or GraalVM. The hunt then pivots to runtime behavior to identify bundled Java versions that may not be tracked in standard software inventories.",
      "guardrails": {
        "claims": "no_unsupported",
        "evidence": "citation_required",
        "telemetry": "untrusted",
        "missing_data": "not_benign"
      },
      "hypothesis": "An unauthenticated attacker has exploited a memory-corruption vulnerability in the JVM HotSpot Base64 decoder to execute code, evidenced by unexpected JVM crashes or Java runtimes spawning shells.",
      "parameters": {
        "scope_hosts": {
          "type": "list[host]",
          "default": [],
          "description": "Optional: Specific hosts to focus on. Leave empty to hunt across the entire estate."
        },
        "lookback_days": {
          "type": "number",
          "default": "14",
          "description": "Days of history to examine."
        },
        "shell_binaries": {
          "type": "list[string]",
          "default": [
            "cmd.exe",
            "powershell.exe",
            "sh",
            "bash",
            "zsh",
            "python",
            "nc",
            "netcat"
          ],
          "description": "Common shell or interpreter binaries used in post-exploitation."
        },
        "affected_versions": {
          "from": {
            "ref": "CVE-2026-114938",
            "kind": "article",
            "observed": "2026-11-17"
          },
          "type": "list[string]",
          "default": [
            "8u511b33-perf",
            "17.0.21.0.3",
            "21.0.13.0.3",
            "25.0.5.0.3",
            "27.0.1.0.3",
            "21.3.20.0.3"
          ],
          "description": "Java and GraalVM versions affected by CVE-2026-114938."
        }
      },
      "provenance": {
        "authors": [
          {
            "org": "huntbase.io",
            "name": "Huntbase hunt generation"
          }
        ],
        "generated": {
          "by": "huntbase-hunt-generation",
          "from": "https://www.cisa.gov/news-events/alerts/2026/11/17/critical-java-vulnerability-requires-immediate-patching",
          "gates": [
            "dry-run",
            "lint",
            "critic"
          ],
          "model": "hb_google/gemini-3-flash-preview"
        }
      },
      "references": [
        {
          "url": "https://www.cisa.gov/news-events/alerts/2026/11/17/critical-java-vulnerability-requires-immediate-patching",
          "name": "CISA Alert: Critical Java Vulnerability Requires Immediate Patching"
        },
        {
          "url": "https://www.oracle.com/security-alerts/cpunov2026.html",
          "name": "Oracle Security Advisory: Critical Security Patch Update \u2013 November 2026"
        }
      ],
      "blind_spots": [
        {
          "id": "incomplete-telemetry",
          "risk": "Java runtimes packaged within application archives may not appear in the software inventory, leading to unpatched and unmonitored exposure.",
          "stage": "java4shell-vulnerability-exposure",
          "question": "Are Java runtimes bundled inside fat JARs or container images visible?",
          "requires": "Deep package inspection or EDR coverage of container internal filesystems"
        },
        {
          "id": "base64-payload-visibility",
          "risk": "Without request body logging, we cannot verify the presence of the malicious Base64 payload, leaving us dependent on process-level side effects like crashes or shells.",
          "stage": "base64-exploitation-traffic",
          "question": "Can we see the specially crafted Base64 input in HTTP requests?",
          "requires": "hb_http_activity with full request body capture"
        }
      ]
    },
    "name": "Java4Shell (CVE-2026-114938) Exploitation and Exposure",
    "description": "This hunt identifies hosts exposed to the Java4Shell (CVE-2026-114938) vulnerability and searches for runtime evidence of exploitation. It scopes the environment using vulnerability findings and software inventory, then uses stack-counting to identify rare or bundled Java runtimes. Finally, it correlates suspicious child processes (shells) and memory-corruption application errors within the HotSpot JVM to identify active exploitation attempts."
  },
  "nodes": [
    {
      "id": "hypothesis",
      "type": "hypothesis",
      "label": "Hypothesis",
      "config": {
        "tags": [],
        "coverage": [
          {
            "stage": "java4shell-vulnerability-exposure",
            "steps": [
              "identify-vulnerable-java",
              "rare-java-execution"
            ],
            "status": "covered"
          },
          {
            "stage": "base64-exploitation-traffic",
            "reason": "The hb_http_activity surface does not provide the HTTP request body logging required to inspect Base64 payloads for malicious content.",
            "status": "not_visible",
            "blind_spot": "base64-payload-visibility"
          },
          {
            "stage": "jvm-process-crash",
            "steps": [
              "jvm-hotspot-crashes"
            ],
            "status": "covered"
          },
          {
            "stage": "post-exploitation-java-activity",
            "steps": [
              "java-spawning-shells"
            ],
            "status": "covered"
          }
        ],
        "rationale": "An unauthenticated attacker has exploited a memory-corruption vulnerability in the JVM HotSpot Base64 decoder to execute code, evidenced by unexpected JVM crashes or Java runtimes spawning shells.",
        "blind_spots": [
          {
            "id": "incomplete-telemetry",
            "risk": "Java runtimes packaged within application archives may not appear in the software inventory, leading to unpatched and unmonitored exposure.",
            "stage": "java4shell-vulnerability-exposure",
            "question": "Are Java runtimes bundled inside fat JARs or container images visible?",
            "requires": "Deep package inspection or EDR coverage of container internal filesystems"
          },
          {
            "id": "base64-payload-visibility",
            "risk": "Without request body logging, we cannot verify the presence of the malicious Base64 payload, leaving us dependent on process-level side effects like crashes or shells.",
            "stage": "base64-exploitation-traffic",
            "question": "Can we see the specially crafted Base64 input in HTTP requests?",
            "requires": "hb_http_activity with full request body capture"
          }
        ],
        "scoping_notes": "Start by identifying internet-facing servers running Java or GraalVM. The hunt then pivots to runtime behavior to identify bundled Java versions that may not be tracked in standard software inventories.",
        "beyond_detection": "A static detection rule for 'java spawning a shell' may be too noisy in environments with developers. This hunt adds context by filtering for vulnerable versions, identifying rare runtime paths, and correlating with JVM-specific memory corruption errors, providing the analyst with a clearer picture of actual compromise."
      }
    },
    {
      "id": "identify-vulnerable-java",
      "type": "query",
      "label": "Identify vulnerable Java installations",
      "config": {
        "dsl": "sqlite",
        "role": "scoping",
        "source": "endpoint",
        "content": "SELECT device_hostname, package_name, package_version, install_path, vendor_name FROM hb_software_inventory WHERE (LOWER(package_name) LIKE '%java%' OR LOWER(package_name) LIKE '%jdk%' OR LOWER(package_name) LIKE '%jre%' OR LOWER(package_name) LIKE '%graalvm%') AND instr(',' || '{{affected_versions}}' || ',', ',' || package_version || ',') > 0 AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0)",
        "surface": "hb_software_inventory",
        "description": "Locate hosts with Java runtimes matching the affected versions named in the advisory.",
        "expected_signal": "A list of hosts and paths where vulnerable Java runtimes are present. These are the primary targets for behavioral analysis."
      },
      "parents": [
        {
          "id": "hypothesis"
        }
      ],
      "primitive_config": {
        "dsl": "sqlite",
        "role": "scoping",
        "label": "Identify vulnerable Java installations",
        "reads": [
          "device_hostname",
          "package_name",
          "package_version",
          "install_path",
          "vendor_name"
        ],
        "source": "hb_software_inventory",
        "target": "endpoint",
        "content": "SELECT device_hostname, package_name, package_version, install_path, vendor_name FROM hb_software_inventory WHERE (LOWER(package_name) LIKE '%java%' OR LOWER(package_name) LIKE '%jdk%' OR LOWER(package_name) LIKE '%jre%' OR LOWER(package_name) LIKE '%graalvm%') AND instr(',' || '{{affected_versions}}' || ',', ',' || package_version || ',') > 0 AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0)",
        "silence": "not_evidence_of_absence",
        "expected": "A list of hosts and paths where vulnerable Java runtimes are present. These are the primary targets for behavioral analysis.",
        "verified": "dry-run",
        "verified_at": "2026-11-18"
      }
    },
    {
      "id": "rare-java-execution",
      "type": "query",
      "label": "Rare Java runtime execution",
      "config": {
        "dsl": "sqlite",
        "role": "baseline",
        "source": "endpoint",
        "content": "SELECT LOWER(process_path) AS java_path, COUNT(DISTINCT device_hostname) AS hosts, MIN(time) AS first_seen, MAX(time) AS last_seen FROM hb_process_activity WHERE (LOWER(process_name) LIKE '%java%' OR LOWER(process_name) LIKE '%jvm%') AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days') GROUP BY java_path HAVING hosts <= 3 ORDER BY hosts ASC",
        "surface": "hb_process_activity",
        "description": "Find rogue or bundled Java runtimes that may be missed by software inventory by stack-counting runtime paths.",
        "expected_signal": "A count of hosts per Java binary path. Rare paths or Java runtimes executing from temporary directories or user profiles indicate high risk."
      },
      "parents": [
        {
          "id": "identify-vulnerable-java"
        }
      ],
      "primitive_config": {
        "dsl": "sqlite",
        "role": "baseline",
        "label": "Rare Java runtime execution",
        "reads": [
          "process_path",
          "device_hostname",
          "time",
          "process_name"
        ],
        "source": "hb_process_activity",
        "target": "endpoint",
        "content": "SELECT LOWER(process_path) AS java_path, COUNT(DISTINCT device_hostname) AS hosts, MIN(time) AS first_seen, MAX(time) AS last_seen FROM hb_process_activity WHERE (LOWER(process_name) LIKE '%java%' OR LOWER(process_name) LIKE '%jvm%') AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days') GROUP BY java_path HAVING hosts <= 3 ORDER BY hosts ASC",
        "silence": "not_evidence_of_absence",
        "baseline": {
          "window": "{{lookback_days}}d",
          "compare": "first_seen"
        },
        "expected": "A count of hosts per Java binary path. Rare paths or Java runtimes executing from temporary directories or user profiles indicate high risk.",
        "verified": "dry-run",
        "prevalence": {
          "by": "device_hostname",
          "key": [
            "process_path"
          ],
          "rare_below": 4
        },
        "verified_at": "2026-11-18"
      }
    },
    {
      "id": "java-spawning-shells",
      "type": "query",
      "label": "Java spawning shells or interpreters",
      "config": {
        "dsl": "sqlite",
        "role": "detection-candidate",
        "source": "endpoint",
        "content": "SELECT device_hostname, process_name, process_cmd_line, parent_process_name, parent_process_cmd_line, user_name, time FROM hb_process_activity WHERE (LOWER(parent_process_name) LIKE '%java%' OR LOWER(parent_process_name) LIKE '%jvm%') AND (instr(',' || '{{shell_binaries}}' || ',', ',' || LOWER(process_original_file_name) || ',') > 0 OR instr(',' || '{{shell_binaries}}' || ',', ',' || LOWER(REPLACE(process_name, '.exe', '')) || ',') > 0 OR LOWER(process_cmd_line) LIKE '%/bin/sh%' OR LOWER(process_cmd_line) LIKE '%/bin/bash%') AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days')",
        "surface": "hb_process_activity",
        "description": "Detect post-exploitation activity where a Java process (the web app) spawns a shell.",
        "expected_signal": "A Java process spawning a shell. While some developer environments exhibit this, it is highly unusual for production web servers and suggests remote code execution."
      },
      "parents": [
        {
          "id": "rare-java-execution"
        }
      ],
      "primitive_config": {
        "dsl": "sqlite",
        "role": "detection-candidate",
        "label": "Java spawning shells or interpreters",
        "reads": [
          "device_hostname",
          "process_name",
          "process_cmd_line",
          "parent_process_name",
          "parent_process_cmd_line",
          "user_name",
          "time",
          "process_original_file_name"
        ],
        "source": "hb_process_activity",
        "target": "endpoint",
        "content": "SELECT device_hostname, process_name, process_cmd_line, parent_process_name, parent_process_cmd_line, user_name, time FROM hb_process_activity WHERE (LOWER(parent_process_name) LIKE '%java%' OR LOWER(parent_process_name) LIKE '%jvm%') AND (instr(',' || '{{shell_binaries}}' || ',', ',' || LOWER(process_original_file_name) || ',') > 0 OR instr(',' || '{{shell_binaries}}' || ',', ',' || LOWER(REPLACE(process_name, '.exe', '')) || ',') > 0 OR LOWER(process_cmd_line) LIKE '%/bin/sh%' OR LOWER(process_cmd_line) LIKE '%/bin/bash%') AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days')",
        "silence": "not_evidence_of_absence",
        "expected": "A Java process spawning a shell. While some developer environments exhibit this, it is highly unusual for production web servers and suggests remote code execution.",
        "verified": "dry-run",
        "verified_at": "2026-11-18"
      }
    },
    {
      "id": "jvm-hotspot-crashes",
      "type": "query",
      "label": "JVM HotSpot memory corruption crashes",
      "config": {
        "dsl": "sqlite",
        "role": "enrichment",
        "source": "endpoint",
        "content": "SELECT device_hostname, app_name, module_name, exception_code, message, time FROM hb_application_error WHERE (LOWER(app_name) LIKE '%java%' OR LOWER(module_name) LIKE '%jvm%' OR LOWER(message) LIKE '%hotspot%') AND (LOWER(exception_code) = 'c0000005' OR LOWER(message) LIKE '%memory%corruption%' OR LOWER(message) LIKE '%segfault%') AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days')",
        "surface": "hb_application_error",
        "description": "Corroborate exploitation by finding application crashes in the HotSpot JVM that align with the memory corruption nature of Java4Shell.",
        "expected_signal": "Frequent crashes in java.exe or jvm.dll with exception code c0000005 (Access Violation). A cluster of these on a vulnerable host suggests exploitation attempts."
      },
      "parents": [
        {
          "id": "java-spawning-shells"
        }
      ],
      "primitive_config": {
        "dsl": "sqlite",
        "role": "enrichment",
        "label": "JVM HotSpot memory corruption crashes",
        "reads": [
          "device_hostname",
          "app_name",
          "module_name",
          "exception_code",
          "message",
          "time"
        ],
        "source": "hb_application_error",
        "target": "endpoint",
        "content": "SELECT device_hostname, app_name, module_name, exception_code, message, time FROM hb_application_error WHERE (LOWER(app_name) LIKE '%java%' OR LOWER(module_name) LIKE '%jvm%' OR LOWER(message) LIKE '%hotspot%') AND (LOWER(exception_code) = 'c0000005' OR LOWER(message) LIKE '%memory%corruption%' OR LOWER(message) LIKE '%segfault%') AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days')",
        "silence": "not_evidence_of_absence",
        "expected": "Frequent crashes in java.exe or jvm.dll with exception code c0000005 (Access Violation). A cluster of these on a vulnerable host suggests exploitation attempts.",
        "verified": "dry-run",
        "verified_at": "2026-11-18"
      }
    },
    {
      "id": "triage-exposure-activity",
      "type": "analytic",
      "label": "Triage Java4Shell risk and activity",
      "config": {
        "cite": "required",
        "tools": [
          "endpoint"
        ],
        "context": [
          "identify-vulnerable-java",
          "rare-java-execution",
          "java-spawning-shells",
          "jvm-hotspot-crashes"
        ],
        "objective": "Examine the identified Java installations, rare runtimes, shells spawned by Java, and HotSpot crashes. Determine if any host shows evidence of CVE-2026-114938 exploitation (e.g., a vulnerable host with a crash followed by a shell).",
        "description": "Evaluate the combined evidence of vulnerability exposure, rare runtimes, suspicious child processes, and crashes.",
        "max_iterations": 4,
        "expected_signal": "A per-host verdict on the likelihood of exploitation.",
        "success_criteria": "A verdict of 'vulnerable', 'suspicious', or 'compromised' per host with citations of specific command lines and exception messages."
      },
      "parents": [
        {
          "id": "jvm-hotspot-crashes"
        }
      ]
    },
    {
      "id": "route-risk",
      "type": "checkpoint",
      "label": "Route on risk and verdict",
      "config": {
        "fuzzy": true,
        "judge": "hunter",
        "question": "the triage-exposure-activity verdict is 'suspicious' or 'compromised' for at least one host",
        "condition": "the triage-exposure-activity verdict is 'suspicious' or 'compromised' for at least one host",
        "blind_spot": "incomplete-telemetry",
        "confidence": "high",
        "description": "Route the hunt results to remediation or close-out based on the agent's findings.",
        "checkpoint_type": "mandatory"
      },
      "parents": [
        {
          "id": "triage-exposure-activity"
        }
      ]
    },
    {
      "id": "remediation-review",
      "type": "task",
      "label": "Remediation and IR review",
      "config": {
        "assignee": "analyst",
        "description": "Initiate remediation for vulnerable hosts and incident response for suspicious activity.",
        "instructions": "For hosts marked 'compromised' or 'suspicious': Collect the Java binary and memory dump if possible; review network logs for outbound traffic from the Java process. For hosts marked 'vulnerable': Apply relevant Java/GraalVM patches immediately, prioritizing internet-facing systems."
      },
      "parents": [
        {
          "id": "route-risk",
          "branch": "on_supports"
        },
        {
          "id": "route-risk",
          "branch": "default"
        },
        {
          "id": "route-risk",
          "branch": "on_unavailable"
        }
      ]
    },
    {
      "id": "close-out",
      "type": "task",
      "label": "Close out",
      "config": {
        "assignee": "analyst",
        "description": "Finalize the hunt and record exposure findings.",
        "instructions": "No active exploitation was detected. Record the list of vulnerable hosts and versions for the vulnerability management team to track patching progress."
      },
      "parents": [
        {
          "id": "route-risk",
          "branch": "on_refutes"
        }
      ]
    }
  ]
}