ColdUserGroup — 1 vulnerability check

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

← All products · Feeds on GitHub

ColdGen ColdUserGroup 1.06 search XSS and LibraryID SQL injection

CVECVE-2010-4913, CVE-2010-4916
Severityhigh · CVSS 7.5
Categorysqli — SQL injection
Serviceshttp, https
Detectionset_var, http_request, script, match · highest QoD 75
Feedtests/vulnerabilities/coldusergroup/CVE-2010-4913.yaml

ColdGen ColdUserGroup 1.06 does not sanitise the Keywords field of its search form, so submitted markup is reflected unescaped (cross-site scripting), and it places the LibraryID parameter of index.cfm into an SQL query without validation (SQL injection).

Under /coldusr and the web root, this check first confirms the "ColdFusion Users Group" text on index.cfm. It then POSTs a search whose Keywords hold a random bold-tag marker and reports the XSS when the marker returns with its tags intact. For the SQL injection it requests a library page with the valid conditions LibraryID=1 and LibraryID=1 and 1=1 as controls, which must not raise a database error, and with the invalid condition LibraryID=1 and 1. A ColdFusion "Error Executing Database Query" page that quotes the injected text proves the value reaches the query unescaped. Nothing is written and no data is read.

How noctis detects it

  1. HTTP(S) request GET {{adir}}/index.cfm
  2. Parses / computes the next value with a Rhai script
  3. HTTP(S) request POST {{adir}}/index.cfm?actcfug=SearchResults with a crafted body
  4. Parses / computes the next value with a Rhai script
  5. Checks xss_resp.body for NOCTIS → finding QoD 75: ColdUserGroup search Keywords cross-site scripting (CVE-2010-4913)
  6. HTTP(S) request GET {{adir}}/index.cfm?actcfug=ViewLibrary&LibraryID=1
  7. HTTP(S) request GET {{adir}}/index.cfm?actcfug=ViewLibrary&LibraryID=1+and+1%3D1
  8. HTTP(S) request GET {{adir}}/index.cfm?actcfug=ViewLibrary&LibraryID=1+and+1
  9. Parses / computes the next value with a Rhai script
  10. Checks inj_resp.body for Error Executing Database Query → finding QoD 75: ColdUserGroup LibraryID SQL injection (CVE-2010-4916)

References:

Feed source — tests/vulnerabilities/coldusergroup/CVE-2010-4913.yaml
# ColdGen ColdUserGroup 1.06 — search Keywords XSS (CVE-2010-4913) and
# LibraryID SQL injection (CVE-2010-4916)
#
# Detection (per candidate dir: /coldusr, then the web root):
#   0. index.cfm must carry the "ColdFusion Users Group" page text.
#   1. XSS, QoD 75 — the search form (index.cfm?actcfug=SearchResults) is
#      POSTed with a random <b>marker</b> in Keywords; the marker comes back
#      with its tags intact (unescaped).
#   2. SQLi, QoD 75 — LibraryID=1 and LibraryID=1 and 1=1 (valid conditions)
#      answer with no database error, then LibraryID=1 and 1 (an invalid
#      condition) answers with "Error Executing Database Query" echoing the
#      statement up to "WHERE LibraryID = 1 and 1": our raw value reached the
#      query.
#
# Read-only: the XSS marker is inert markup, the SQL payload is a
# syntactically invalid condition; nothing is written, no data is read.
#
# Ported from OpenVAS/Greenbone NVT `2011/gb_coldusergroup_xss_n_sql_inj_vuln.nasl`
# (OID 1.3.6.1.4.1.25623.1.0.802254, GPL-2.0-only). Improvements: the XSS uses
# a random inert marker instead of a script payload, and the SQL injection
# (which the original never tested) is proven through a control/error pair.
# The query action name for LibraryID (actcfug=ViewLibrary) is not published;
# it is the likely name, so a deployment using another name is a possible miss.
# CVSS: NVD carries only CVSS v2 scores (XSS 4.3, SQLi 7.5).
uid: 46315615-8cc2-46fe-9ea7-1f1cf3f7dd5e
name: "ColdGen ColdUserGroup 1.06 search XSS and LibraryID SQL injection (CVE-2010-4913, CVE-2010-4916)"
description: |
  ColdGen ColdUserGroup 1.06 does not sanitise the Keywords field of its
  search form, so submitted markup is reflected unescaped (cross-site
  scripting), and it places the LibraryID parameter of index.cfm into an SQL
  query without validation (SQL injection).

  Under /coldusr and the web root, this check first confirms the
  "ColdFusion Users Group" text on index.cfm. It then POSTs a search whose
  Keywords hold a random bold-tag marker and reports the XSS when the marker
  returns with its tags intact. For the SQL injection it requests a library
  page with the valid conditions LibraryID=1 and LibraryID=1 and 1=1 as
  controls, which must not raise a database error, and with the invalid
  condition LibraryID=1 and 1. A ColdFusion "Error Executing Database Query"
  page that quotes the injected text proves the value reaches the query
  unescaped. Nothing is written and no data is read.
cves: [CVE-2010-4913, CVE-2010-4916]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.30
tags: [coldusergroup, coldfusion, sqli, xss, error-based]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-4913"
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-4916"

steps:
  - id: init-idx
    action: set_var
    var_name: idx
    var_value: {status: 0, body: null}
    loop:
      over: ["/coldusr", ""]
      var: adir

  - id: init-xss
    action: set_var
    var_name: xss_resp
    var_value: {status: 0, body: null}

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

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

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

  - id: index
    action: http_request
    method: GET
    port: "{{port}}"
    path: "{{adir}}/index.cfm"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: idx

  - id: marker
    action: script
    code: |
      "NOCTIS" + oob_token.sub_string(0, 8)
    store_as: mk

  - id: xss-post
    action: http_request
    method: POST
    port: "{{port}}"
    path: "{{adir}}/index.cfm?actcfug=SearchResults"
    condition: 'idx.status == 200 && type_of(idx.body) == "string" && stridx(idx.body, "ColdFusion Users Group") >= 0'
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    headers:
      Content-Type: "application/x-www-form-urlencoded"
    body: "SubmitForm=Search%20Site&Keywords=%3Cb%3E{{mk}}%3C%2Fb%3E&Category=Articles"
    store_as: xss_resp

  - id: xss-check
    action: script
    code: |
      let b = if type_of(xss_resp.body) == "string" { xss_resp.body } else { "" };
      #{ hit: xss_resp.status == 200 && stridx(b, "<b>" + mk + "</b>") >= 0 }
    store_as: xres

  - id: xss-report
    action: match
    source: xss_resp.body
    pattern: "NOCTIS"
    condition: "xres.hit"
    on_match:
      finding:
        title: "ColdUserGroup search Keywords cross-site scripting (CVE-2010-4913)"
        description: "A search submitted with a random bold-tag marker in the Keywords field came back with the tags unescaped, so markup or script supplied in Keywords runs in the browser of anyone who follows a crafted search link or form."
        remediation: "HTML-encode Keywords (htmlEditFormat) before printing it; upgrade ColdUserGroup to a release that fixes CVE-2010-4913."
        cves: [CVE-2010-4913]
        cvss: 4.3
        severity: medium
        confidence_delta: 0.45
        qod: 75
        evidence: "{{adir}}/index.cfm?actcfug=SearchResults: POSTed Keywords marker returned inside unescaped <b> tags"

  - id: control-plain
    action: http_request
    method: GET
    port: "{{port}}"
    path: "{{adir}}/index.cfm?actcfug=ViewLibrary&LibraryID=1"
    condition: 'idx.status == 200 && type_of(idx.body) == "string" && stridx(idx.body, "ColdFusion Users Group") >= 0'
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: ctl1

  - id: control-true
    action: http_request
    method: GET
    port: "{{port}}"
    path: "{{adir}}/index.cfm?actcfug=ViewLibrary&LibraryID=1+and+1%3D1"
    condition: 'ctl1.status == 200 && type_of(ctl1.body) == "string" && !ereg("Error Executing Database", ctl1.body)'
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: ctl2

  - id: inject
    action: http_request
    method: GET
    port: "{{port}}"
    path: "{{adir}}/index.cfm?actcfug=ViewLibrary&LibraryID=1+and+1"
    condition: 'ctl2.status == 200 && type_of(ctl2.body) == "string" && !ereg("Error Executing Database", ctl2.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("Error Executing Database Query", b) && ereg("WHERE LibraryID = 1 and 1", b) }
    store_as: res

  - id: report
    action: match
    source: inj_resp.body
    pattern: "Error Executing Database Query"
    condition: "res.err"
    on_match:
      finding:
        title: "ColdUserGroup LibraryID SQL injection (CVE-2010-4916)"
        description: "The valid conditions LibraryID=1 and LibraryID=1 and 1=1 returned the library page, while LibraryID=1 and 1 made ColdFusion print an Error Executing Database Query page quoting the injected text in the WHERE clause: the value reaches an SQL query unescaped, so an unauthenticated attacker can run arbitrary SQL against the application database."
        remediation: "Validate LibraryID as an integer and use cfqueryparam in the query; upgrade ColdUserGroup to a release that fixes CVE-2010-4916."
        cves: [CVE-2010-4916]
        cvss: 7.5
        severity: high
        confidence_delta: 0.45
        qod: 75
        evidence: "{{adir}}/index.cfm?actcfug=ViewLibrary: LibraryID=1 and 1=1 answers normally, LibraryID=1 and 1 answers with Error Executing Database Query quoting WHERE LibraryID = 1 and 1"
      stop: true

View these feeds on GitHub