Comersus — 2 vulnerability checks

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

← All products · Feeds on GitHub

Comersus BackOffice Lite comersus_backoffice_install10.asp authentication bypass

CVECVE-2005-0301
Severityhigh · CVSS 7.5
Categoryauth-bypass — Auth bypass
Serviceshttp, https
Detectionset_var, http_request, tcp_connect, script, match · highest QoD 97
Feedtests/vulnerabilities/comersus/CVE-2005-0301.yaml

Tests Comersus BackOffice Lite 6.0 and 6.0.1 for the authentication bypass through its leftover installer page (CVE-2005-0301): requesting comersus_backoffice_install10.asp, the last step of the installation wizard, logs the visitor's session in to the BackOffice without a password. The test first loads the store settings form (comersus_backoffice_settingsModifyForm.asp) without cookies as a control, then loads the installer's final page and opens the settings form again with the session cookie it handed out. The "Modify Store Settings" form shown with that session, while the control was refused, confirms administrative access without credentials. A settings form that is served even without a session, or the installer's final page alone, is reported with lower confidence. Only GET requests are sent and no setting is changed. The /comersus/backofficeLite, /comersus and /backofficeLite directories and the web root are tried.

How noctis detects it

  1. HTTP(S) request GET {{base}}/comersus_backoffice_settingsModifyForm.asp
  2. Raw TCP (TLS on HTTPS), sent verbatim: GET {{base}}/comersus_backoffice_install10.asp HTTP/1.0
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request GET {{base}}/comersus_backoffice_settingsModifyForm.asp
  5. HTTP(S) request GET {{base}}/{{p.rname}}
  6. Parses / computes the next value with a Rhai script
  7. Checks v.proof for ^bypass$ → finding QoD 97: Comersus BackOffice Lite installer page grants an admin session (CVE-2005-0301)
  8. Checks v.proof for ^unprotected$ → finding QoD 75: Comersus BackOffice Lite installer page reachable and admin pages unprotected (CVE-2005-0301)
  9. Checks v.proof for ^installer$ → finding QoD 70: Comersus BackOffice Lite installer final page reachable (CVE-2005-0301)

References:

Feed source — tests/vulnerabilities/comersus/CVE-2005-0301.yaml
# Comersus BackOffice Lite 6.0 / 6.0.1 — installer final step grants an admin session (CVE-2005-0301)
#
# The BackOffice Lite installation wizard ends on comersus_backoffice_install10.asp ("Final
# Step", "Installation complete"). The page stays on the server after installation and,
# requested directly, marks the visitor's ASP session as logged in to the BackOffice: every
# admin page (comersus_backoffice_settingsModifyForm.asp, "Modify Store Settings" under the
# "Basic Admin Utility" header) then opens without a password. The vendor fix is to delete
# the installer files. Advisory: Bugtraq 2005-01-21 "bug report comersus Back Office Lite
# 6.0 and 6.0.1" (BID 12362). The product (classic ASP) source is no longer published; the
# page markers are the ones of the advisory-era check.
#
# Detection, per candidate install directory (/comersus/backofficeLite, /comersus,
# /backofficeLite, web root):
#   1. Control: GET comersus_backoffice_settingsModifyForm.asp without cookies — must NOT
#      show the settings form (an installed BackOffice redirects to its login page).
#   2. GET comersus_backoffice_install10.asp over a raw socket (every Set-Cookie header of
#      the reply is kept: http_request keeps only the last one) — the installer's final
#      page ("Installation complete", "Final Step", "Installation Wizard").
#   3. GET the settings form again with the session cookies handed out in step 2.
#   Settings form with the session while the control was refused → admin access without
#   credentials, QoD 97. Settings form served even without a session → reported at QoD 75
#   (installer present and admin pages unprotected). Installer final page alone (its
#   session does not open the admin pages, or no cookie) → QoD 70, after a control on a
#   random sibling installer name rules out a catch-all page.
#   Only GET requests are sent; nothing is submitted, the settings form is only read.
#
# Better than the source check: it read only the first Set-Cookie header and had no
# control, so a site that serves the settings page to anyone was attributed to the
# installer, and a session cookie that was not the first header was lost. This feed adds
# the cookie-less control and the catch-all control, sends back every cookie, reports the
# installer alone at lower confidence, and also tries the /backofficeLite and web-root
# layouts. The session cookie is not put in the evidence.
#
# CVSS: NVD has only a v2 score for CVE-2005-0301 (7.5, AV:N/AC:L/Au:N/C:P/I:P/A:P).
#
# Backlog source: OpenVAS/Greenbone NVT pre2008/backoffice_lite_bypass.nasl
# (OID 1.3.6.1.4.1.25623.1.0.16227, GPL-2.0-only).
uid: 1ef5acc1-b565-436f-b0bd-e45dd77e4460
name: "Comersus BackOffice Lite comersus_backoffice_install10.asp authentication bypass (CVE-2005-0301)"
description: |
  Tests Comersus BackOffice Lite 6.0 and 6.0.1 for the authentication bypass through its
  leftover installer page (CVE-2005-0301): requesting comersus_backoffice_install10.asp,
  the last step of the installation wizard, logs the visitor's session in to the
  BackOffice without a password. The test first loads the store settings form
  (comersus_backoffice_settingsModifyForm.asp) without cookies as a control, then loads
  the installer's final page and opens the settings form again with the session cookie it
  handed out. The "Modify Store Settings" form shown with that session, while the control
  was refused, confirms administrative access without credentials. A settings form that is
  served even without a session, or the installer's final page alone, is reported with
  lower confidence. Only GET requests are sent and no setting is changed. The
  /comersus/backofficeLite, /comersus and /backofficeLite directories and the web root
  are tried.
cves: [CVE-2005-0301]
cvss: 7.5
severity: high
confidence_base: 0.30
category: auth-bypass
tags: [comersus, asp, auth-bypass, installer, web-abuse]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2005-0301"
  - "http://marc.info/?l=bugtraq&m=110636597832556&w=2"
  - "http://www.securityfocus.com/bid/12362"
  - "https://exchange.xforce.ibmcloud.com/vulnerabilities/19010"

steps:
  # ── Loop group: every step below runs once per candidate install directory ──
  # Pre-initialise every stored result a script reads (an undefined variable aborts the
  # whole test).
  - id: init-ctrl
    action: set_var
    var_name: ctrl
    var_value: {status: 0, body: null, headers: {}}
    loop:
      over: ["/comersus/backofficeLite", "/comersus", "/backofficeLite", ""]
      var: base

  - id: init-ins
    action: set_var
    var_name: ins
    var_value: {connected: false, banner: null}

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

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

  # 1. Control — the settings form without any cookie.
  - id: control
    action: http_request
    method: GET
    path: "{{base}}/comersus_backoffice_settingsModifyForm.asp"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    store_as: ctrl

  # 2. The installer's final page, raw, to keep every Set-Cookie header.
  - id: install10
    action: tcp_connect
    port: "{{port}}"
    send: "GET {{base}}/comersus_backoffice_install10.asp HTTP/1.0\r\nHost: {{target_host}}:{{port}}\r\nUser-Agent: Mozilla/5.0\r\nAccept: */*\r\n\r\n"
    store_as: ins

  - id: parse
    action: script
    code: |
      let out = #{ install: false, cookie: "", names: "", rname: "comersus_backoffice_install" + rand_hex(6) + ".asp" };
      if type_of(ins.banner) == "string" {
        let raw = ins.banner;
        let cut = stridx(raw, "\r\n\r\n");
        if cut < 0 { cut = stridx(raw, "\n\n"); }
        if cut >= 0 {
          let head = substr(raw, 0, cut);
          let body = substr(raw, cut, strlen(raw));
          out.install = ereg("^HTTP/1\\.[01] 200", head)
            && stridx(body, "Installation complete") >= 0
            && stridx(body, "Final Step") >= 0
            && stridx(body, "Installation Wizard") >= 0;
          if out.install {
            let jar = #{};
            for line in split(head, "\n") {
              let c = eregmatch("^set-cookie[0-9]?:[ \\t]*([A-Za-z0-9_.-]+)=([^;\\r]*)", line, true);
              if c.len() < 3 || c[2] == "" || c[2] == "deleted" { continue; }
              jar[c[1]] = c[2];
            }
            for k in jar.keys() {
              if out.cookie != "" {
                out.cookie += "; ";
                out.names += ", ";
              }
              out.cookie += k + "=" + jar[k];
              out.names += k;
            }
          }
        }
      }
      out
    store_as: p

  # 3. The settings form with the session the installer page handed out.
  - id: admin
    action: http_request
    method: GET
    path: "{{base}}/comersus_backoffice_settingsModifyForm.asp"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    condition: "p.install == true && p.cookie != \"\""
    headers:
      Cookie: "{{p.cookie}}"
    store_as: adm

  # Catch-all control for the installer-only branch: a random sibling installer name.
  - id: random-sibling
    action: http_request
    method: GET
    path: "{{base}}/{{p.rname}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    condition: "p.install == true"
    store_as: rnd

  - id: verdict
    action: script
    code: |
      fn settings_form(r) {
        let b = r.body;
        r.status == 200 && type_of(b) == "string"
          && stridx(b, "Modify Store Settings") >= 0
          && stridx(b, "Basic Admin Utility") >= 0
          && !ereg("(?i)<input[^>]*type=[\"']?password", b)
      }
      let rb = rnd.body;
      let catchall = rnd.status == 200 && type_of(rb) == "string"
        && stridx(rb, "Installation complete") >= 0 && stridx(rb, "Final Step") >= 0;
      let open = settings_form(ctrl);
      let admin = p.install == true && settings_form(adm);
      let proof = "";
      if p.install == true && !catchall {
        proof = if admin && !open { "bypass" } else if admin && open { "unprotected" } else { "installer" };
      }
      #{ proof: proof, ctrl_status: ctrl.status }
    store_as: v

  - id: bypass-confirmed
    action: match
    source: v.proof
    pattern: "^bypass$"
    condition: "v.proof == \"bypass\""
    on_match:
      stop: true
      finding:
        title: "Comersus BackOffice Lite installer page grants an admin session (CVE-2005-0301)"
        confidence_delta: 0.65
        qod: 97
        evidence: "Administrative access without credentials: GET {{base}}/comersus_backoffice_settingsModifyForm.asp without cookies did not show the settings form (HTTP {{v.ctrl_status}}); GET {{base}}/comersus_backoffice_install10.asp returned the installation wizard's final page (\"Installation complete\") with session cookies ({{p.names}}), and the settings form requested again with that session returned the \"Modify Store Settings\" page of the Basic Admin Utility."
        remediation: "Delete comersus_backoffice_install10.asp and every other comersus_backoffice_install*.asp file from the server once the installation is complete, and restrict the BackOffice directory to administrators."

  - id: unprotected
    action: match
    source: v.proof
    pattern: "^unprotected$"
    condition: "v.proof == \"unprotected\""
    on_match:
      stop: true
      finding:
        title: "Comersus BackOffice Lite installer page reachable and admin pages unprotected (CVE-2005-0301)"
        confidence_delta: 0.45
        qod: 75
        evidence: "GET {{base}}/comersus_backoffice_install10.asp returned the installation wizard's final page (\"Installation complete\"), and {{base}}/comersus_backoffice_settingsModifyForm.asp returned the \"Modify Store Settings\" page of the Basic Admin Utility, even without any session cookie."
        remediation: "Delete comersus_backoffice_install10.asp and every other comersus_backoffice_install*.asp file from the server once the installation is complete, and restrict the BackOffice directory to administrators."

  - id: installer-present
    action: match
    source: v.proof
    pattern: "^installer$"
    condition: "v.proof == \"installer\""
    on_match:
      stop: true
      finding:
        title: "Comersus BackOffice Lite installer final page reachable (CVE-2005-0301)"
        confidence_delta: 0.40
        qod: 70
        evidence: "GET {{base}}/comersus_backoffice_install10.asp returned the installation wizard's final page (\"Installation complete\", \"Final Step\") while a random sibling installer name did not; this page grants an administrative BackOffice session on Comersus BackOffice Lite 6.0 and 6.0.1 (the settings form could not be confirmed with its session here)."
        remediation: "Delete comersus_backoffice_install10.asp and every other comersus_backoffice_install*.asp file from the server once the installation is complete, and restrict the BackOffice directory to administrators."

Comersus Cart message parameter cross-site scripting

CVECVE-2004-0681
Severitymedium · CVSS 6.8
Categoryxss — XSS
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 75
Feedtests/vulnerabilities/comersus/CVE-2004-0681.yaml

Comersus Cart, a classic ASP shopping cart, prints the message parameter of comersus_message.asp, comersus_supportError.asp, comersus_customerAuthenticateForm.asp and the back office comersus_backoffice_message.asp into the page without HTML encoding, so a crafted link runs attacker script in the browser of a shopper or administrator who follows it.

Under /comersus/store, /comersus, /store and the web root (back office: /comersus/backofficeLite and /backofficeLite), this check requests each page with a message that closes an HTML attribute and opens a script element carrying a random marker. The flaw is confirmed when the page (HTTP 200) returns that script element unescaped, and a random page of the same directory, given the same parameter, does not (which rules out servers that echo any URL).

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{v.d}}/{{v.page}}?message={{sc.p}}
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request GET {{v.d}}/{{sc.ctl}}?message={{sc.p}}
  5. Parses / computes the next value with a Rhai script
  6. Checks hit for \.asp\?message= → finding QoD 75: Comersus Cart message parameter cross-site scripting (CVE-2004-0681)

References:

Feed source — tests/vulnerabilities/comersus/CVE-2004-0681.yaml
# Comersus Cart — message parameter reflected cross-site scripting (CVE-2004-0681).
#
# Comersus Cart 5.09 (classic ASP shopping cart) prints the `message` parameter
# of comersus_message.asp, comersus_supportError.asp and
# comersus_customerAuthenticateForm.asp (store directory) and of
# backofficeLite/comersus_backoffice_message.asp into the page without HTML
# encoding (BID 10674, EDB-24261; the comersus_message.asp vector is still
# reported against 7.0.7, EDB-30205, and EDB-7259). The product sources are not
# published any more; the vectors follow the advisories and NVD.
#
# Detection (QoD 75): each page is requested under /comersus/store, /comersus,
# /store and the web root (back office: /comersus/backofficeLite and
# /backofficeLite) with message="><script>alert(/noctis<random>/)</script><".
# The flaw is confirmed when the reply (HTTP 200) carries the script element
# verbatim, not inside a single-quoted attribute, and a random .asp page of the
# same directory, given the same query, does not (servers that echo any URL raw
# are not reported).
#
# Ported from OpenVAS/Greenbone NVT `pre2008/comersus_xss.nasl`
# (OID 1.3.6.1.4.1.25623.1.0.12640, GPL-2.0-only): comersus_message.asp under
# /comersus/store and the CGI dirs with the static `vttest<script>foo</script>`
# marker, skipped when the host reflects XSS generically. Differences: random
# marker, the three other pages NVD lists are tried too, and the generic
# reflection control is done per directory with the same query.
# CVE mapping: the backlog issue also names CVE-2004-0682 (price tampering in
# comersus_gatewayPayPal.asp, same BID, EDB-24260). Nothing here tests it, so the feed
# names CVE-2004-0681 only.
# CVSS: NVD carries only a CVSS v2 score (6.8).
uid: dc01ee23-a0c5-4b51-883d-f4ae4564fc49
name: "Comersus Cart message parameter cross-site scripting (CVE-2004-0681)"
description: |
  Comersus Cart, a classic ASP shopping cart, prints the message parameter of
  comersus_message.asp, comersus_supportError.asp,
  comersus_customerAuthenticateForm.asp and the back office
  comersus_backoffice_message.asp into the page without HTML encoding, so a
  crafted link runs attacker script in the browser of a shopper or
  administrator who follows it.

  Under /comersus/store, /comersus, /store and the web root (back office:
  /comersus/backofficeLite and /backofficeLite), this check requests each page
  with a message that closes an HTML attribute and opens a script element
  carrying a random marker. The flaw is confirmed when the page (HTTP 200)
  returns that script element unescaped, and a random page of the same
  directory, given the same parameter, does not (which rules out servers that
  echo any URL).
cves: [CVE-2004-0681]
cvss: 6.8
severity: medium
category: xss
confidence_base: 0.30
tags: [comersus, shopping-cart, ecommerce, asp, xss, reflected]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2004-0681"
  - "http://www.securityfocus.com/bid/10674"
  - "https://www.exploit-db.com/exploits/24261"
  - "https://www.exploit-db.com/exploits/30205"

steps:
  - id: gen-marker
    action: script
    code: |
      let tok = "noctis" + rand_int(10000000, 99999999);
      #{ tok: tok,
         want: "\"><script>alert(/" + tok + "/)</script>",
         sq: "='[^'<>]*\"><script>alert\\(/" + tok + "/\\)",
         p: "%22%3E%3Cscript%3Ealert%28%2F" + tok + "%2F%29%3C%2Fscript%3E%3C%22",
         ctl: "noctis" + rand_hex(6) + ".asp" }
    store_as: sc

  - id: init-hit
    action: set_var
    var_name: hit
    var_value: ""

  # ── Per install dir × page (loop group) ───────────────────────────────────
  - id: init-r
    action: set_var
    var_name: r
    var_value: {status: 0, body: ""}
    loop:
      var: v
      over:
        - {d: "/comersus/store", page: "comersus_message.asp"}
        - {d: "/comersus", page: "comersus_message.asp"}
        - {d: "/store", page: "comersus_message.asp"}
        - {d: "", page: "comersus_message.asp"}
        - {d: "/comersus/store", page: "comersus_supportError.asp"}
        - {d: "/comersus", page: "comersus_supportError.asp"}
        - {d: "/store", page: "comersus_supportError.asp"}
        - {d: "", page: "comersus_supportError.asp"}
        - {d: "/comersus/store", page: "comersus_customerAuthenticateForm.asp"}
        - {d: "/comersus", page: "comersus_customerAuthenticateForm.asp"}
        - {d: "/store", page: "comersus_customerAuthenticateForm.asp"}
        - {d: "", page: "comersus_customerAuthenticateForm.asp"}
        - {d: "/comersus/backofficeLite", page: "comersus_backoffice_message.asp"}
        - {d: "/backofficeLite", page: "comersus_backoffice_message.asp"}

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

  - id: probe
    action: http_request
    method: GET
    path: "{{v.d}}/{{v.page}}?message={{sc.p}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 5
    condition: 'hit == ""'
    store_as: r

  - id: check-probe
    action: script
    condition: 'hit == ""'
    code: |
      let b = if type_of(r.body) == "string" { r.body } else { "" };
      r.status == 200 && b.contains(sc.want) && !ereg(sc.sq, b)
    store_as: reflected

  # Generic-reflection control: same query on a random page of the directory.
  - id: control
    action: http_request
    method: GET
    path: "{{v.d}}/{{sc.ctl}}?message={{sc.p}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 5
    condition: 'hit == "" && reflected'
    store_as: c

  - id: check
    action: script
    condition: 'hit == ""'
    code: |
      let cb = if type_of(c.body) == "string" { c.body } else { "" };
      if reflected && !cb.contains(sc.want) { v.d + "/" + v.page + "?message=" } else { "" }
    store_as: hit

  # ── Finding ───────────────────────────────────────────────────────────────
  - id: report
    action: match
    source: hit
    pattern: "\\.asp\\?message="
    condition: 'hit != ""'
    on_match:
      finding:
        title: "Comersus Cart message parameter cross-site scripting (CVE-2004-0681)"
        description: "Comersus Cart returned a script element passed in the message parameter without HTML encoding: a crafted link runs attacker script in the browser of a shopper or store administrator who follows it, in the context of the store."
        remediation: "Upgrade Comersus Cart to a release that HTML-encodes the message parameter before printing it, or remove the cart: the product is no longer maintained."
        confidence_delta: 0.50
        qod: 75
        evidence: "{{hit}} + attribute break-out returned {{sc.want}} unescaped (HTTP 200); a random page of the same directory did not reflect it"
      stop: true

View these feeds on GitHub