EspoCRM — 1 vulnerability check

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

← All products · Feeds on GitHub

EspoCRM install/index.php Re-install Access and Reflected XSS

CVECVE-2014-7985, CVE-2014-7986, CVE-2014-7987
Severitycritical · CVSS 10.0
Categoryxss — XSS
Serviceshttp, https
Detectionscript, set_var, tcp_connect, match · highest QoD 75
Feedtests/vulnerabilities/espocrm/espocrm-installer-reinstall-xss.yaml

Tests EspoCRM before 2.6.0 for the installer that stays reachable through installProcess=1 (CVE-2014-7986) and the reflected XSS in its errors action (CVE-2014-7987, same script as the CVE-2014-7985 action LFI). Sends an inert per-run HTML tag in `desc` and confirms the installer page echoes it unescaped inside its error box.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. Raw TCP (TLS on HTTPS), sent verbatim: GET {{ctx}}/install/index.php?installProcess=1&action=errors&desc=%3Cnoctis{{tok}}%3E HTT…
  3. Parses / computes the next value with a Rhai script
  4. Checks resp.banner for <title>EspoCRM</title> → finding QoD 75: EspoCRM installer re-opened with installProcess=1 and reflected the inert tag <noctis…> unescaped in its error box — …/install/index.php?in…

References:

Feed source — tests/vulnerabilities/espocrm/espocrm-installer-reinstall-xss.yaml
# EspoCRM < 2.6.0 — installer re-opened after install (CVE-2014-7986) + reflected
# XSS in the errors action (CVE-2014-7987); same unfixed install/index.php as the
# action-parameter local file inclusion (CVE-2014-7985).
#
# install/index.php of EspoCRM 2.5.2 copies every request parameter into
# $_SESSION['install'] and only redirects an installed instance away when
# $_SESSION['install']['installProcess'] is unset — so ?installProcess=1 re-opens
# the installer on a live CRM (CVE-2014-7986: anyone can re-install it). Its
# `errors` action (install/core/actions/errors.php) then assigns the raw `desc`
# parameter to Smarty, and errors.tpl prints it unescaped inside
# <div id="msg-box" class="alert alert-danger">…</div> (CVE-2014-7987). 2.6.0
# reads `action` from POST only, ignores `installProcess`, and drops `desc`.
#
# Detection (QoD 75 — response analysis, benign proof):
#   One GET per candidate context path (the NASL's "/", "/EspoCRM", "/crm",
#   "/CRM", plus "/espocrm"):
#     <ctx>/install/index.php?installProcess=1&action=errors&desc=%3Cnoctis<tok>%3E
#   The host is vulnerable when the EspoCRM installer page (<title>EspoCRM</title>)
#   comes back with the inert per-run tag <noctis<tok>> intact inside the
#   msg-box div. That proves both the installer is reachable (on an installed CRM
#   that is CVE-2014-7986) and the unescaped reflection (CVE-2014-7987). Nothing
#   is executed or re-installed: the tag has no attribute or handler, and the
#   parameters only land in the scanner's own fresh PHP session.
#   CVE-2014-7985 (LFI through `action`) is listed for tracking — it lives in the
#   same unfixed script and is fixed by the same release — but is not exploited:
#   including arbitrary PHP files is not a benign probe.
#
# Better than the NASL (2014/gb_espocrm_multiple_vuln.nasl):
#   - per-run random inert tag instead of the static alert(document.cookie)
#     string, so a page quoting the public PoC cannot produce a finding;
#   - the tag must sit inside EspoCRM's own msg-box div, not anywhere in the body
#     (the NASL's "License Agreement" extra check is satisfied by the language
#     JSON every installer page embeds, so it adds nothing);
#   - no dependency on a prior index.php "&copy; … EspoCRM" fingerprint, which
#     newer themes / a reverse proxy can lack; the installer page itself carries
#     the product proof.
#
# Encoded payload in the query → verbatim HTTP/1.0 via tcp_connect, matched on
# resp.banner (TLS is automatic on https).
#
# Ported from OpenVAS/Greenbone NVT 2014/gb_espocrm_multiple_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.804874, GPL-2.0-only).
uid: 478febaa-691b-48a2-bfb0-75cf5546cd7c
name: "EspoCRM install/index.php Re-install Access and Reflected XSS (CVE-2014-7986, CVE-2014-7987)"
description: |
  Tests EspoCRM before 2.6.0 for the installer that stays reachable through
  installProcess=1 (CVE-2014-7986) and the reflected XSS in its errors action
  (CVE-2014-7987, same script as the CVE-2014-7985 action LFI). Sends an inert
  per-run HTML tag in `desc` and confirms the installer page echoes it unescaped
  inside its error box.
cves: [CVE-2014-7985, CVE-2014-7986, CVE-2014-7987]
cvss: 10.0
severity: critical
confidence_base: 0.30
category: xss
tags: [espocrm, crm, php, installer, xss, reflected-xss, access-control, web-abuse]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2014-7985"
  - "https://nvd.nist.gov/vuln/detail/CVE-2014-7986"
  - "https://nvd.nist.gov/vuln/detail/CVE-2014-7987"
  - "https://github.com/espocrm/espocrm/blob/2.5.2/install/index.php"
  - "OpenVAS/Greenbone NASL 2014/gb_espocrm_multiple_vuln.nasl (GPL-2.0-only)"

steps:
  # Per-run token: rand_hex(12) => 24 lowercase hex chars.
  - id: mint-token
    action: script
    code: 'rand_hex(12)'
    store_as: tok

  # ── Loop group: every step below runs once per candidate context path ────
  # Pre-initialise the stored result so a refused connection never leaves
  # `resp` undefined for the verify script (which would abort the test).
  - id: init-resp
    action: set_var
    var_name: resp
    var_value: {connected: false, banner: null}
    loop:
      over: ["", "/EspoCRM", "/crm", "/CRM", "/espocrm"]
      var: ctx

  - id: xss-probe
    action: tcp_connect
    port: "{{port}}"
    send: "GET {{ctx}}/install/index.php?installProcess=1&action=errors&desc=%3Cnoctis{{tok}}%3E HTTP/1.0\r\nHost: {{target_host}}\r\nAccept: text/html,*/*\r\nConnection: close\r\n\r\n"
    timeout_secs: 10
    store_as: resp

  # The raw tag must come back inside EspoCRM's installer error box. An
  # HTML-encoded echo (&lt;noctis…&gt;) or a redirect of an installed, fixed CRM
  # (2.6.0 ignores GET action/installProcess) does not match.
  - id: verify
    action: script
    code: |
      let b = resp.banner;
      if type_of(b) != "string" { false }
      else {
        let i = stridx(b, "id=\"msg-box\"");
        i >= 0
          && stridx(b, "<title>EspoCRM</title>") >= 0
          && stridx(substr(b, i, strlen(b) - 1), "<noctis" + tok + ">") >= 0
      }
    store_as: xss_hit

  - id: xss-match
    action: match
    source: resp.banner
    pattern: "<title>EspoCRM</title>"
    condition: "xss_hit == true"
    on_match:
      finding:
        confidence_delta: 0.55
        qod: 75
        evidence: "EspoCRM installer re-opened with installProcess=1 and reflected the inert tag <noctis{{tok}}> unescaped in its error box — {{ctx}}/install/index.php?installProcess=1&action=errors&desc=%3Cnoctis{{tok}}%3E"
      stop: true

View these feeds on GitHub