QuiXplorer — 1 vulnerability check

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

← All products · Feeds on GitHub

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