SonicWALL Aventail — 1 vulnerability check

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

← All products · Feeds on GitHub

SonicWALL Aventail prodpage.cfm CategoryID SQL injection

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

The prodpage.cfm page of SonicWALL Aventail puts the CategoryID parameter into an SQL query without sanitising it, allowing unauthenticated SQL injection against the application database.

This check first requests prodpage.cfm with CategoryID=1, which must not raise a database error. It then sends CategoryID with a quote followed by a random marker generated for the scan. An "ODBC Error" page that quotes the statement fragment AND Products.CategoryID = '' followed by the marker proves the value reaches the query unescaped. Nothing is written and no data is read from the database.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{adir}}/prodpage.cfm?CFID=&CFTOKEN=&CategoryID=1
  3. HTTP(S) request GET {{adir}}/prodpage.cfm?CFID=&CFTOKEN=&CategoryID=%27{{mk}}
  4. Parses / computes the next value with a Rhai script
  5. Checks inj_resp.body for ODBC Error → finding QoD 75: SonicWALL Aventail prodpage.cfm CategoryID SQL injection (CVE-2011-5262)

References:

Feed source — tests/vulnerabilities/sonicwall-aventail/CVE-2011-5262.yaml
# SonicWALL Aventail — prodpage.cfm CategoryID SQL injection (CVE-2011-5262)
#
# The CategoryID parameter of prodpage.cfm is placed into a ColdFusion query
# unescaped. A stray quote makes the ODBC driver fail and ColdFusion prints the
# failing statement, which quotes our own text.
#
# Detection (per candidate dir: web root plus /cgi-bin style dirs below):
#   1. Control: CategoryID=1 answers without any "ODBC Error".
#   2. QoD 75 — CategoryID='<random marker> answers with "ODBC Error" and a
#      statement echo "AND Products.CategoryID = ''<marker>": a value only this
#      scan generated reached the SQL text, so the quote escaped the literal.
#
# Read-only: the payload is a malformed literal, nothing is written and no
# data is read from the database.
#
# Ported from OpenVAS/Greenbone NVT `2011/gb_sonicwall_50702.nasl`
# (OID 1.3.6.1.4.1.25623.1.0.103342, GPL-2.0-only). Differences: a clean valid
# control request and a per-run random marker replace the fixed string.
# CVSS: NVD carries only a CVSS v2 score (7.5).
uid: 27bb7e81-24d3-47b1-8792-eb32cc50b0af
name: "SonicWALL Aventail prodpage.cfm CategoryID SQL injection (CVE-2011-5262)"
description: |
  The prodpage.cfm page of SonicWALL Aventail puts the CategoryID parameter
  into an SQL query without sanitising it, allowing unauthenticated SQL
  injection against the application database.

  This check first requests prodpage.cfm with CategoryID=1, which must not
  raise a database error. It then sends CategoryID with a quote followed by a
  random marker generated for the scan. An "ODBC Error" page that quotes the
  statement fragment AND Products.CategoryID = '' followed by the marker proves
  the value reaches the query unescaped. Nothing is written and no data is
  read from the database.
cves: [CVE-2011-5262]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.30
tags: [sonicwall, aventail, coldfusion, sqli, error-based]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2011-5262"

steps:
  - id: marker
    action: script
    code: |
      "noctis" + rand_hex(6)
    store_as: mk

  - id: init-ctl
    action: set_var
    var_name: ctl
    var_value: {status: 0, body: null}
    loop:
      over: ["", "/cgi-bin"]
      var: adir

  - id: init-inj
    action: set_var
    var_name: inj_resp
    var_value: {status: 0, body: null}

  - id: control
    action: http_request
    method: GET
    port: "{{port}}"
    path: "{{adir}}/prodpage.cfm?CFID=&CFTOKEN=&CategoryID=1"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: ctl

  - id: inject
    action: http_request
    method: GET
    port: "{{port}}"
    path: "{{adir}}/prodpage.cfm?CFID=&CFTOKEN=&CategoryID=%27{{mk}}"
    condition: 'ctl.status == 200 && type_of(ctl.body) == "string" && !ereg("ODBC Error", ctl.body)'
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: inj_resp

  - id: check
    action: script
    code: |
      let b = if type_of(inj_resp.body) == "string" { inj_resp.body } else { "" };
      #{ err: inj_resp.status >= 200 && inj_resp.status < 600 && ereg("ODBC Error", b) && stridx(b, "AND Products.CategoryID = ''" + mk) >= 0 }
    store_as: res

  - id: report
    action: match
    source: inj_resp.body
    pattern: "ODBC Error"
    condition: "res.err"
    on_match:
      finding:
        title: "SonicWALL Aventail prodpage.cfm CategoryID SQL injection (CVE-2011-5262)"
        description: "CategoryID=1 returned the page normally, while CategoryID with a quote and a random marker made ColdFusion print an ODBC Error page quoting the statement fragment AND Products.CategoryID = '' followed by the marker: the value reaches an SQL query unescaped, so an unauthenticated attacker can run arbitrary SQL against the application database."
        remediation: "Validate CategoryID as an integer and use cfqueryparam in the query; upgrade SonicWALL Aventail to a release that fixes CVE-2011-5262."
        confidence_delta: 0.45
        qod: 75
        evidence: "{{adir}}/prodpage.cfm: CategoryID=1 answers normally, CategoryID with a quote and the marker answers with ODBC Error quoting AND Products.CategoryID = '' and the marker"
      stop: true

View these feeds on GitHub