QuiXplorer — 2 vulnerability checks

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

← All products · Feeds on GitHub

QuiXplorer index.php Arbitrary File Upload

CVECVE-2011-5005
Severityhigh · CVSS 7.5
Categoryrce — Remote code execution
Serviceshttp, https
Detectionset_var, http_request, script, match · highest QoD 70
Feedtests/vulnerabilities/quixplorer/CVE-2011-5005.yaml

Checks for a QuiXplorer web file manager release affected by the unrestricted file upload in the upload action of index.php, which lets an attacker store a file with an executable extension in the web tree and run it. The feed requests the login or listing page of the usual install directories (the web root, /quixplorer, /filemanager and /filemgr, with and without the src folder), reads the version printed in the page footer and reports a release at or below 2.3. The check only reads a page and uploads nothing; it identifies the vulnerable release by version, so a build with a local fix is not told apart.

How noctis detects it

  1. HTTP(S) request GET {{script}}
  2. Parses / computes the next value with a Rhai script
  3. Checks ver.version for ^[0-9]+\.[0-9]+ → finding QoD 70: QuiXplorer index.php Arbitrary File Upload (CVE-2011-5005)

References:

Feed source — tests/vulnerabilities/quixplorer/CVE-2011-5005.yaml
# QuiXplorer unrestricted file upload — CVE-2011-5005
#
# NVD: "Unrestricted file upload vulnerability in QuiXplorer 2.3 and earlier
# allows remote attackers to execute arbitrary code by uploading a file with
# an executable extension using the upload action to index.php, then accessing
# it via a direct request to the file in an unspecified directory."
#
# Detection (non-intrusive, QoD 70): the upload action stores a file under the
# server's document tree, so no write-free behavioural proof exists; the only
# exploit is a persistent file write on the target, which this feed never
# attempts. QuiXplorer prints its version in the page footer ("QuiXplorer 2.3",
# "QuiXplorer Version 2.5.3 (BETA)"); the feed reads it from the login or
# listing page and reports 2.3 and earlier (NVD cpe range, versionEndIncluding
# 2.3; the 2.3.x maintenance releases share the 2.3 branch).
#
# Improvements over the source NASL: it uploaded a PHP file (phpinfo) to the
# target and left it there; this feed only reads the page footer, so it is safe
# to run against production. Both the repository layout (<dir>/src/index.php)
# and a copied src/ (<dir>/index.php) are probed, and the version is compared
# numerically instead of matched as a string.
#
# Ported from OpenVAS/Greenbone NVT 2012/gb_QuiXplorer_50673.nasl
# (GPL-2.0-only).
uid: 5d1c3e0a-7b84-4f52-9a0e-2c6f81b94d37
name: "QuiXplorer index.php Arbitrary File Upload (CVE-2011-5005)"
description: |
  Checks for a QuiXplorer web file manager release affected by the unrestricted
  file upload in the upload action of index.php, which lets an attacker store a
  file with an executable extension in the web tree and run it. The feed
  requests the login or listing page of the usual install directories (the web
  root, /quixplorer, /filemanager and /filemgr, with and without the src
  folder), reads the version printed in the page footer and reports a release
  at or below 2.3. The check only reads a page and uploads nothing; it
  identifies the vulnerable release by version, so a build with a local fix is
  not told apart.
cves: [CVE-2011-5005]
cvss: 7.5
severity: high
category: rce
confidence_base: 0.30
tags: [quixplorer, file-manager, file-upload, php]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2011-5005"
  - "https://www.securityfocus.com/bid/50673"
  # OpenVAS/Greenbone NASL 2012/gb_QuiXplorer_50673.nasl (GPL-2.0-only)

steps:
  - id: init-probe-r
    action: set_var
    var_name: probe_r
    var_value: {status: 0, body: ""}
    loop:
      var: script
      over:
        - "/src/index.php"
        - "/quixplorer/src/index.php"
        - "/filemanager/src/index.php"
        - "/filemgr/src/index.php"
        - "/quixplorer/index.php"
        - "/filemanager/index.php"
        - "/filemgr/index.php"

  - id: probe
    action: http_request
    method: GET
    path: "{{script}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: probe_r

  # Version in a page text node naming QuiXplorer, compared numerically.
  - id: version
    action: script
    code: |
      let out = #{ ok: false, vuln: false, version: "" };
      if probe_r.status == 200 && type_of(probe_r.body) == "string" {
        let m = eregmatch(">[^<]*QuiXplorer (?:Version )?([0-9]+)\\.([0-9]+)(?:\\.([0-9]+))?", probe_r.body);
        if type_of(m) == "array" && m.len() >= 3 {
          let maj = int(m[1]);
          let min = int(m[2]);
          let v = m[1] + "." + m[2];
          if m.len() > 3 && m[3] != "" { v += "." + m[3]; }
          out = #{ ok: true, vuln: maj < 2 || (maj == 2 && min <= 3), version: v };
        }
      }
      out
    store_as: ver

  - id: report
    action: match
    condition: "ver.ok == true && ver.vuln == true"
    source: ver.version
    pattern: "^[0-9]+\\.[0-9]+"
    on_match:
      finding:
        title: "QuiXplorer index.php Arbitrary File Upload (CVE-2011-5005)"
        description: "The page footer shows a QuiXplorer release up to 2.3, whose upload action of index.php does not restrict the extension of the uploaded file. An attacker can store a script file in the web tree and run it with the privileges of the web server."
        remediation: "QuiXplorer is no longer maintained and no fix was published for this release: remove it or restrict access to it (web-server authentication, VPN), and migrate to a maintained file manager."
        confidence_delta: 0.40
        qod: 70
        evidence: "GET {{script}} returned a QuiXplorer page reporting version {{ver.version}}"
      stop: true

QuiXplorer index.php srt Parameter Reflected XSS

CVECVE-2013-1642
Severitymedium · CVSS 6.1
Categoryxss — XSS
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 75
Feedtests/vulnerabilities/quixplorer/CVE-2013-1642.yaml

Tests the QuiXplorer web file manager for the reflected cross-site scripting in the sort parameters of index.php. The feed requests src/index.php under the web root, /quixplorer, /filemanager and /filemgr, and index.php directly under the last three (installs that copied the src folder), with an srt value made of a random marker followed by "><script>alert(document.cookie);</script>. A vulnerable QuiXplorer copies the value unescaped into the links of the page it renders (the login form action, or the toolbar links when no login is required), so the double quote closes the attribute and a script element is added. The finding requires a QuiXplorer page holding an attribute that ends with this scan's marker, followed by the injected script element, verbatim. A version that HTML-escapes the value is not reported. The request only renders the login or listing page and changes nothing on the server.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{script}}?action=list&order=name&srt={{tok}}%22%3E%3Cscript%3Ealert%28document.cooki…
  3. Parses / computes the next value with a Rhai script
  4. Checks xss_proof for ^srt=noctis[0-9a-f]{12}"><script>alert\(document\.cookie\);</script>$ → finding QoD 75: QuiXplorer index.php srt Parameter Reflected XSS (CVE-2013-1642)

References:

Feed source — tests/vulnerabilities/quixplorer/CVE-2013-1642.yaml
# QuiXplorer reflected XSS through the srt parameter — CVE-2013-1642
#
# QuiXplorer copies the `order` and `srt` query values of index.php raw into
# every link built by make_link() (src/_include/fun_extra.php):
#     $link .= "&order=".$_order;  $link .= "&srt=".$_srt;
# With the default require_login = true, an unauthenticated request lands on
# the login page, whose form action (src/_include/login.php) and footer
# "Login" link are such links, inside a double-quoted attribute:
#     <FORM name="login" action="http://HOST/src/index.php?action=login&order=name&srt=<srt>" ...
# so srt=<x>"><script>...</script> closes the attribute and the tag and adds a
# script element. With require_login = false the directory listing toolbar
# links (src/_include/fun_list.php) reflect it the same way. The upstream
# repository (realtimeprojects/quixplorer, read at v2.4.3, v2.5.4, v2.5.8 and
# master) never escapes these two values: init.php and make_link() are
# unchanged on this point up to the last commit, so every release answers
# the probe, not only the "2.5.4 and prior" of the advisory.
#
# Detection (benign, read-only): GET <dir>/src/index.php?action=list&order=name
# &srt=<marker>"><script>alert(document.cookie);</script> (percent-encoded),
# where <marker> is random per scan, on the usual install dirs (both the
# repository layout <dir>/src/index.php and a copied src/ as <dir>/index.php). Reported when
# a QuiXplorer page (a text node containing "QuiXplorer": the login header or
# the footer link) holds, verbatim, a double-quoted attribute value ending in
# srt=<marker> (optionally followed by a backslash) and "><script>alert(document.cookie);</script>. QoD 75.
#
# Improvements over the source NASL:
#   - Random marker per scan: a page that always prints the bare
#     "><script>alert(document.cookie);</script> string is not reported.
#   - The reflection must sit at the end of an attribute holding srt=<marker>,
#     i.e. the quote that breaks out of the attribute is proven too.
#   - The NASL requires `title.*QuiXplorer Version`, which only the 2.5.x
#     footer prints; 2.4.x footers ("QuiXplorer 2.4.3") were missed. Any text
#     node naming QuiXplorer is accepted here.
#   - The NASL's PHP-capability pre-check is dropped (the reply proves PHP).
#   - Installs that copied src/ as <dir>/index.php are probed too.
#   - 2.5.8+ dropped stripslashes(): under PHP magic_quotes_gpc the quote comes
#     back as \" (still a breakout in HTML); an optional backslash is accepted.
#
# CVE-2013-1641 (zip download path traversal in the download_selected action,
# fixed in 2.5.5) is listed by the same advisory but needs a logged-in session
# with the default configuration; it is not covered by this feed.
#
# Ported from OpenVAS/Greenbone NVT 2014/gb_quixplorer_mult_vuln_nov.nasl
# (GPL-2.0-only). Vulnerable code read from github.com/realtimeprojects/quixplorer.
uid: 86ba9497-b4e0-4a09-bc92-c9e2be786fa4
name: "QuiXplorer index.php srt Parameter Reflected XSS (CVE-2013-1642)"
description: |
  Tests the QuiXplorer web file manager for the reflected cross-site
  scripting in the sort parameters of index.php. The feed requests
  src/index.php under the web root, /quixplorer, /filemanager and /filemgr,
  and index.php directly under the last three (installs that copied the
  src folder), with an srt value made of a random marker followed by
  "><script>alert(document.cookie);</script>. A vulnerable QuiXplorer copies
  the value unescaped into the links of the page it renders (the login form
  action, or the toolbar links when no login is required), so the double
  quote closes the attribute and a script element is added. The finding
  requires a QuiXplorer page holding an attribute that ends with this scan's
  marker, followed by the injected script element, verbatim. A version that
  HTML-escapes the value is not reported. The request only renders the login
  or listing page and changes nothing on the server.
cves: [CVE-2013-1642]
cvss: 6.1
severity: medium
category: xss
confidence_base: 0.30
tags: [quixplorer, file-manager, xss, php]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2013-1642"
  - "https://github.com/realtimeprojects/quixplorer"
  # OpenVAS/Greenbone NASL 2014/gb_quixplorer_mult_vuln_nov.nasl (GPL-2.0-only)

steps:
  # Random marker for this scan (letters and hex digits only).
  - id: marker
    action: script
    code: |
      "noctis" + oob_token.sub_string(0, 8) + oob_token.sub_string(9, 4)
    store_as: tok

  # ── Loop group: every following step runs once per install dir. Each pass
  # resets the values it reads, so nothing is left over from the previous dir.
  - id: init-probe-r
    action: set_var
    var_name: probe_r
    var_value: {status: 0, body: ""}
    loop:
      var: script
      over:
        - "/src/index.php"
        - "/quixplorer/src/index.php"
        - "/filemanager/src/index.php"
        - "/filemgr/src/index.php"
        - "/quixplorer/index.php"
        - "/filemanager/index.php"
        - "/filemgr/index.php"

  - id: probe
    action: http_request
    method: GET
    path: "{{script}}?action=list&order=name&srt={{tok}}%22%3E%3Cscript%3Ealert%28document.cookie%29%3B%3C%2Fscript%3E"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: probe_r

  # The injected script element right after a double-quoted attribute value
  # ending in srt=<marker>, on a QuiXplorer page — or "".
  - id: reflection
    action: script
    code: |
      let out = "";
      if probe_r.status == 200 && type_of(probe_r.body) == "string" {
        let b = probe_r.body;
        // Product check on page text (case-sensitive "QuiXplorer" in a text
        // node): the login header or the footer link. The probed path is
        // lower-case and sits in attributes, so a URL echo does not pass.
        if ereg(">[^<]*QuiXplorer[^<]*<", b) {
          let want = "srt=" + tok + "\"><script>alert(document.cookie);</script>";
          // \\? : PHP magic_quotes_gpc with QuiXplorer 2.5.8+ (no
          // stripslashes) prints a backslash before the quote; still a breakout.
          if ereg("=[ \\t]*\"[^\"<>]*[?&]srt=" + tok + "\\\\?\"><script>alert\\(document\\.cookie\\);</script>", b) {
            out = want;
          }
        }
      }
      out
    store_as: xss_proof

  - id: report
    action: match
    source: xss_proof
    pattern: '^srt=noctis[0-9a-f]{12}"><script>alert\(document\.cookie\);</script>$'
    on_match:
      finding:
        title: "QuiXplorer index.php srt Parameter Reflected XSS (CVE-2013-1642)"
        description: "A QuiXplorer page requested with an srt parameter ending in a double quote and a script element was rendered with that value copied unescaped into a double-quoted link attribute, so the quote closes the attribute and the script element is added to the page. An attacker can send a crafted link that runs script in the browser of a QuiXplorer user, including on the login page."
        remediation: "QuiXplorer is no longer maintained and no release escapes these parameters: remove it or restrict access to it (for example behind web-server authentication or a VPN), and migrate to a maintained file manager."
        confidence_delta: 0.55
        qod: 75
        evidence: "GET {{script}}?action=list&order=name&srt=<marker>%22%3E%3Cscript%3E... returned HTTP 200 with a QuiXplorer page containing the attribute breakout: {{xss_proof}}"
      stop: true

View these feeds on GitHub