Jojo CMS — 1 vulnerability check

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

← All products · Feeds on GitHub

Jojo CMS forgot-password search Field Reflected XSS

CVECVE-2013-3082
Severitymedium · CVSS 4.3
Categoryxss — XSS
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 75
Feedtests/vulnerabilities/jojo-cms/CVE-2013-3082.yaml

Tests Jojo CMS before 1.2.2 for the cross-site scripting flaw in its forgot-password page. The feed requests the site root, /jojo and /cms to recognise a Jojo CMS site, then posts the password-reset form with a search value that closes the current tag and adds a script element holding a random marker. A vulnerable site prints the value back unescaped, so the finding requires the reply to hold the injected script element with this scan's marker verbatim. A site that HTML-escapes the value, or a page that merely echoes the request, is not reported. The request only submits a lookup form 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 {{jdir}}/
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request POST {{jdir}}/forgot-password/ with a crafted body
  5. Parses / computes the next value with a Rhai script
  6. Checks xss_proof for ^alert\(noctis[0-9a-f]{12}\)$ → finding QoD 75: Jojo CMS forgot-password search Field Reflected XSS (CVE-2013-3082)

References:

Feed source — tests/vulnerabilities/jojo-cms/CVE-2013-3082.yaml
# Jojo CMS forgot-password search reflected XSS — CVE-2013-3082
#
# plugins/jojo_core/forgot_password.php (served at /forgot-password/) prints the
# POSTed "search" field back into the page without HTML-escaping, so a value
# starting with "> closes the current attribute and tag and adds a script
# element. Fixed in Jojo 1.2.2. The tracking issue also lists CVE-2013-3081
# (SQL injection through the X-Forwarded-For header on /articles/test/); that
# one cannot be shown without altering a query on the target, so only the XSS
# is proven here and the feed names CVE-2013-3082.
#
# Detection (benign, read-only): for each candidate install dir, GET <dir>/
# and require the Jojo CMS generator marker and the jojocms.org link; then POST
# the reset form to <dir>/forgot-password/ with search = "><script>alert(<marker>)</script>
# (random <marker> per scan) and report when the 200 reply holds that script
# element verbatim, still on a Jojo CMS page. QoD 75.
#
# Improvements over the source NASL:
#   - Random marker per scan instead of the fixed alert(document.cookie): a
#     page that always prints that string is not reported.
#   - The request body carries the angle brackets percent-encoded, so only a
#     decoded reflection matches; a plain request echo is not reported.
#
# Ported from OpenVAS/Greenbone NVT 2013/gb_jojo_cms_mult_vuln.nasl (GPL-2.0-only).
uid: 5cfbc14d-fd56-4b99-9e62-16eb50c1ffba
name: "Jojo CMS forgot-password search Field Reflected XSS (CVE-2013-3082)"
description: |
  Tests Jojo CMS before 1.2.2 for the cross-site scripting flaw in its
  forgot-password page. The feed requests the site root, /jojo and /cms to
  recognise a Jojo CMS site, then posts the password-reset form with a search
  value that closes the current tag and adds a script element holding a random
  marker. A vulnerable site prints the value back unescaped, so the finding
  requires the reply to hold the injected script element with this scan's
  marker verbatim. A site that HTML-escapes the value, or a page that merely
  echoes the request, is not reported. The request only submits a lookup form
  and changes nothing on the server.
cves: [CVE-2013-3082]
cvss: 4.3
severity: medium
category: xss
confidence_base: 0.30
tags: [jojo, jojo-cms, cms, xss, php]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2013-3082"
  - "https://nvd.nist.gov/vuln/detail/CVE-2013-3081"
  - "OpenVAS/Greenbone NASL 2013/gb_jojo_cms_mult_vuln.nasl (GPL-2.0-only)"

steps:
  - id: marker
    action: script
    code: |
      "noctis" + oob_token.sub_string(0, 8) + oob_token.sub_string(9, 4)
    store_as: tok

  # Loop group: the following steps run once per install dir.
  - id: init-gate
    action: set_var
    var_name: gate
    var_value: {status: 0, body: ""}
    loop:
      var: jdir
      over: ["", "/jojo", "/cms"]

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

  - id: gate-probe
    action: http_request
    method: GET
    port: "{{port}}"
    path: "{{jdir}}/"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    store_as: gate

  - id: gate-check
    action: script
    code: |
      let ok = false;
      if gate.status == 200 && type_of(gate.body) == "string" {
        ok = stridx(gate.body, "\"Jojo CMS") >= 0
          && stridx(gate.body, "http://www.jojocms.org") >= 0;
      }
      ok
    store_as: is_jojo

  - id: reset-probe
    action: http_request
    method: POST
    port: "{{port}}"
    path: "{{jdir}}/forgot-password/"
    headers:
      Content-Type: "application/x-www-form-urlencoded"
    body: "type=reset&search=%22%3E%3Cscript%3Ealert%28{{tok}}%29%3C%2Fscript%3E&btn_reset=Send"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: reset
    condition: "is_jojo"

  - id: reflection
    action: script
    code: |
      let out = "";
      if is_jojo && reset.status == 200 && type_of(reset.body) == "string" {
        if stridx(reset.body, "\"><script>alert(" + tok + ")</script>") >= 0
          && stridx(reset.body, "\"Jojo CMS") >= 0 {
          out = "alert(" + tok + ")";
        }
      }
      out
    store_as: xss_proof

  - id: report
    action: match
    source: xss_proof
    pattern: '^alert\(noctis[0-9a-f]{12}\)$'
    on_match:
      finding:
        title: "Jojo CMS forgot-password search Field Reflected XSS (CVE-2013-3082)"
        description: "The Jojo CMS forgot-password page printed the submitted search value back into the page without HTML-escaping, so a value that closes the current tag and opens a script element added a script element to the page. An attacker can lure a user or administrator to a crafted form submission that runs script in their browser."
        remediation: "Upgrade Jojo CMS to 1.2.2 or later. Until then, HTML-escape the search value before printing it."
        confidence_delta: 0.45
        qod: 75
        evidence: "POST {{jdir}}/forgot-password/ with a random-marker script breakout returned HTTP 200 holding the unescaped element: \"><script>{{xss_proof}}</script>"
      stop: true

View these feeds on GitHub