PivotX — 2 vulnerability checks

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

← All products · Feeds on GitHub

PivotX <= 2.3.10 file extension check bypass and session fixation

CVECVE-2015-5457, CVE-2015-5458
Severityhigh · CVSS 7.5
Categoryrce — Remote code execution
Serviceshttp, https
Detectionset_var, http_request, script, match · highest QoD 70
Feedtests/vulnerabilities/pivotx/pivotx-file-upload-session-fixation.yaml

PivotX, a PHP weblog, does not validate the new extension when a file with several extensions (such as foo.php.php) is renamed, which lets an attacker who can upload files run PHP code (CVE-2015-5457), and fileupload.php accepts a session identifier through its sess parameter, which allows session fixation (CVE-2015-5458). Versions before 2.3.11 are affected.

Uploading a file would write to the target, so this check identifies the release instead: on the usual install paths (/pivotx, the web root, /pivot) it requests index.php and reads the version from the generator meta tag (PivotX - 2.3.10 - ...). It reports a version lower than 2.3.11, with a lower confidence than an exploit proof.

How noctis detects it

  1. HTTP(S) request GET {{dir}}/index.php
  2. Parses / computes the next value with a Rhai script
  3. Checks hit for runs PivotX → finding QoD 70: PivotX <= 2.3.10 file extension check bypass and session fixation (CVE-2015-5457, CVE-2015-5458)

References:

Feed source — tests/vulnerabilities/pivotx/pivotx-file-upload-session-fixation.yaml
# PivotX <= 2.3.10 — file extension check bypass (CVE-2015-5457) and session fixation in
# fileupload.php (CVE-2015-5458), both fixed in 2.3.11.
#
# Why version only (QoD 70): proving the extension bypass means uploading a file with a double
# extension (foo.php.php), and the session fixation needs a victim session; neither is
# something a scanner should do on a target, so the check identifies the release instead.
# PivotX prints it in a generator meta tag: <meta name="generator" content="PivotX - 2.3.10 - ...">.
# The reflected XSS of the same release (CVE-2015-5456) has an active proof in CVE-2015-5456.yaml.
# Related OpenVAS/Greenbone NVT `2015/gb_pivotx_mult_vuln_jul15.nasl`
# (OID 1.3.6.1.4.1.25623.1.0.805938, GPL-2.0-only) lists all three CVEs for the same release.
# CVSS: NVD carries only CVSS v2 scores (7.5 for CVE-2015-5457, 6.8 for CVE-2015-5458); the
# higher one is used.
uid: 465c480c-1e13-4b64-ade3-493c53a35333
name: "PivotX <= 2.3.10 file extension check bypass and session fixation (CVE-2015-5457, CVE-2015-5458)"
description: |
  PivotX, a PHP weblog, does not validate the new extension when a file with
  several extensions (such as foo.php.php) is renamed, which lets an attacker
  who can upload files run PHP code (CVE-2015-5457), and fileupload.php accepts
  a session identifier through its sess parameter, which allows session
  fixation (CVE-2015-5458). Versions before 2.3.11 are affected.

  Uploading a file would write to the target, so this check identifies the
  release instead: on the usual install paths (/pivotx, the web root, /pivot)
  it requests index.php and reads the version from the generator meta tag
  (PivotX - 2.3.10 - ...). It reports a version lower than 2.3.11, with a lower
  confidence than an exploit proof.
cves: [CVE-2015-5457, CVE-2015-5458]
cvss: 7.5
severity: high
category: rce
confidence_base: 0.30
tags: [pivotx, weblog, php, upload, session-fixation, version-check]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2015-5457"
  - "https://nvd.nist.gov/vuln/detail/CVE-2015-5458"
  - "https://www.securityfocus.com/bid/75577"

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

  - id: init-page
    action: set_var
    var_name: page
    var_value: {status: 0, body: ""}
    loop:
      var: dir
      over: ["/pivotx", "", "/pivot"]

  - id: fetch-index
    action: http_request
    method: GET
    path: "{{dir}}/index.php"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 8
    condition: 'hit == ""'
    store_as: page

  # Product gate + version: the generator meta tag. Vulnerable below 2.3.11,
  # compared numerically per component.
  - id: check-version
    action: script
    condition: 'hit == ""'
    code: |
      let b = if type_of(page.body) == "string" { page.body } else { "" };
      let out = "";
      if page.status == 200 {
        let m = eregmatch("<meta name=\"generator\" content=\"PivotX - ([0-9]{1,4}(?:\\.[0-9]{1,4}){1,3})", b);
        if type_of(m) == "array" && m.len() > 1 {
          let ver = m[1];
          let p = split(ver, ".");
          let v = [0, 0, 0, 0];
          for i in 0..p.len() { v[i] = int(p[i]); }
          let n = ((v[0] * 10000 + v[1]) * 10000 + v[2]) * 10000 + v[3];
          if n < ((2 * 10000 + 3) * 10000 + 11) * 10000 {
            out = dir + "/index.php runs PivotX, generator \"PivotX - " + ver + "\"";
          }
        }
      }
      out
    store_as: hit

  - id: report
    action: match
    source: hit
    pattern: "runs PivotX"
    on_match:
      finding:
        title: "PivotX <= 2.3.10 file extension check bypass and session fixation (CVE-2015-5457, CVE-2015-5458)"
        description: "The site runs a PivotX release older than 2.3.11. These releases do not validate the extension when a file with several extensions is renamed (code execution for an uploader) and let a session identifier be fixed through the sess parameter of fileupload.php. Detected from the version only; no file is uploaded."
        remediation: "Upgrade PivotX to 2.3.11 or later."
        confidence_delta: 0.45
        qod: 70
        evidence: "{{hit}}; fixed in 2.3.11"
      stop: true

PivotX <= 2.3.10 formclass.php PATH_INFO cross-site scripting

CVECVE-2015-5456
Severitymedium · CVSS 4.3
Categoryxss — XSS
Serviceshttp, https
Detectionset_var, http_request, script, match · highest QoD 75
Feedtests/vulnerabilities/pivotx/CVE-2015-5456.yaml

PivotX, a PHP weblog, builds the action of its forms from PHP_SELF in modules/formclass.php without encoding it, so text appended to index.php/ (PATH_INFO) is written unescaped into the page. A crafted link therefore runs attacker script in the browser of a visitor (reflected cross-site scripting). Versions before 2.3.11 are affected.

On the usual install paths (/pivotx, the web root, /pivot) the check requests index.php with a script tag appended to the path and a page that contains a form. It reports the finding when the PivotX page returns the tag unencoded. Nothing is stored on the target and the script is only reflected.

How noctis detects it

  1. HTTP(S) request GET {{dir}}/index.php/%22%3E%3Cscript%3Ealert(document.cookie)%3C/script%3E%3C/script%3E?…
  2. Parses / computes the next value with a Rhai script
  3. Checks hit for reflects the PATH_INFO → finding QoD 75: PivotX <= 2.3.10 formclass.php PATH_INFO cross-site scripting (CVE-2015-5456)

References:

Feed source — tests/vulnerabilities/pivotx/CVE-2015-5456.yaml
# PivotX <= 2.3.10 — reflected XSS through PATH_INFO in modules/formclass.php, CVE-2015-5456.
#
# The form method of modules/formclass.php builds the form action from PHP_SELF without
# encoding it, so text appended to index.php/ lands unescaped inside the page's <form
# action="...">. The probe appends `"><script>alert(document.cookie)</script></script>` to
# index.php (page=page&uid=3 is a page that carries a form) and reads the reply; the payload is
# only reflected, never executed by the scanner and nothing is written on the target.
#
# Ported from OpenVAS/Greenbone NVT `2015/gb_pivotx_mult_vuln_jul15.nasl`
# (OID 1.3.6.1.4.1.25623.1.0.805938, GPL-2.0-only): the NASL reads
# <dir>/index.php/"><script>alert(document.cookie)</script></script>?page=page&uid=3 and needs
# the reflected script plus ">PivotX" in the reply. Differences: tries /pivotx, the web root
# and /pivot (the NASL uses the CPE-detected dir); the reflection must come back
# unencoded (a literal `"><script>`), and the PivotX marker must be a generator meta tag or the
# "Powered by PivotX" text, so a generic reflector is not reported.
# The same advisory also lists CVE-2015-5457 (file extension) and CVE-2015-5458 (session
# fixation), see pivotx-file-upload-session-fixation.yaml.
# CVSS: NVD carries only a CVSS v2 score (4.3).
uid: 92a30d28-ef99-49bf-b1b4-72b442c507bc
name: "PivotX <= 2.3.10 formclass.php PATH_INFO cross-site scripting (CVE-2015-5456)"
description: |
  PivotX, a PHP weblog, builds the action of its forms from PHP_SELF in
  modules/formclass.php without encoding it, so text appended to index.php/
  (PATH_INFO) is written unescaped into the page. A crafted link therefore runs
  attacker script in the browser of a visitor (reflected cross-site scripting).
  Versions before 2.3.11 are affected.

  On the usual install paths (/pivotx, the web root, /pivot) the check requests
  index.php with a script tag appended to the path and a page that contains a
  form. It reports the finding when the PivotX page returns the tag unencoded.
  Nothing is stored on the target and the script is only reflected.
cves: [CVE-2015-5456]
cvss: 4.3
severity: medium
category: xss
confidence_base: 0.30
tags: [pivotx, weblog, php, xss, reflected]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2015-5456"
  - "https://www.securityfocus.com/bid/75577"

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

  - id: init-page
    action: set_var
    var_name: page
    var_value: {status: 0, body: ""}
    loop:
      var: dir
      over: ["/pivotx", "", "/pivot"]

  - id: probe
    action: http_request
    method: GET
    path: "{{dir}}/index.php/%22%3E%3Cscript%3Ealert(document.cookie)%3C/script%3E%3C/script%3E?page=page&uid=3"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 8
    condition: 'hit == ""'
    store_as: page

  - id: check
    action: script
    condition: 'hit == ""'
    code: |
      let b = if type_of(page.body) == "string" { page.body } else { "" };
      let out = "";
      if page.status == 200
         && stridx(b, "\"><script>alert(document.cookie)</script>") >= 0
         && (stridx(b, "content=\"PivotX") >= 0 || stridx(b, "Powered by PivotX") >= 0) {
        out = dir + "/index.php reflects the PATH_INFO script tag unencoded in a PivotX page";
      }
      out
    store_as: hit

  - id: report
    action: match
    source: hit
    pattern: "reflects the PATH_INFO"
    on_match:
      finding:
        title: "PivotX <= 2.3.10 formclass.php PATH_INFO cross-site scripting (CVE-2015-5456)"
        description: "The PivotX form on this site writes the request's PATH_INFO unescaped into its action attribute. A crafted index.php/ link runs attacker script in the browser of a visitor who follows it. The check only reads the reflected tag; nothing is stored."
        remediation: "Upgrade PivotX to 2.3.11 or later."
        confidence_delta: 0.45
        qod: 75
        evidence: "{{hit}}"
      stop: true

View these feeds on GitHub