ClanLite — 1 vulnerability check

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

← All products · Feeds on GitHub

ClanLite calendrier.php XSS and profil.php SQL Injection

CVECVE-2008-5214, CVE-2008-5215
Severityhigh · CVSS 7.5
Categorysqli — SQL injection
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 75
Feedtests/vulnerabilities/clanlite/clanlite-calendrier-xss-profil-sqli.yaml

Tests ClanLite (2.2006.05.20 and earlier) for two flaws. Under /clanlite and in the web root, once service/index_pri.php shows the ClanLite page title, the feed sends the annee parameter of service/calendrier.php a quote and a script element that only carries a random marker, and reports the reflected cross-site scripting when that exact element comes back unescaped; a control request with the same payload in an unknown parameter must not reflect it. It then sends the link parameter of service/profil.php a single quote and reports the SQL injection when the reply contains a MySQL syntax error that a numeric link does not produce. Nothing is read or changed, and the script only reaches the scanner.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{d}}/service/index_pri.php
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request GET {{d}}/service/calendrier.php?mois=6&annee={{sc.payload}}
  5. HTTP(S) request GET {{d}}/service/calendrier.php?mois=6&annee=2006&{{sc.marker}}={{sc.payload}}
  6. Parses / computes the next value with a Rhai script
  7. Checks xss_hit for ^yes$ → finding QoD 75: ClanLite calendrier.php annee Reflected Cross-Site Scripting (CVE-2008-5214)
  8. HTTP(S) request GET {{d}}/service/profil.php?link=1%27
  9. HTTP(S) request GET {{d}}/service/profil.php?link=1
  10. Parses / computes the next value with a Rhai script
  11. Checks sqli_hit for ^yes$ → finding QoD 75: ClanLite profil.php link SQL Injection (CVE-2008-5215)
  12. Parses / computes the next value with a Rhai script

References:

Feed source — tests/vulnerabilities/clanlite/clanlite-calendrier-xss-profil-sqli.yaml
# ClanLite calendrier.php 'annee' XSS (CVE-2008-5214) and profil.php 'link'
# SQL injection (CVE-2008-5215)
#
# ClanLite 2.2006.05.20 and earlier (French PHP/MySQL clan-site CMS, no
# published source) prints the annee parameter of service/calendrier.php
# unescaped inside an attribute (CVE-2008-5214) and pastes the link parameter
# of service/profil.php into an SQL query unquoted-safe (CVE-2008-5215).
# The request shapes come from the public advisories and the source NASL.
#
# Detection (benign, read-only), under /clanlite and the web root:
#   1. GET service/index_pri.php must carry the "<title>ClanLite" page title.
#   2. XSS: GET service/calendrier.php?mois=6&annee='><script>alert(/<marker>/)</script>
#      (percent-encoded, random marker); the exact script element must come
#      back unescaped. A control with the same payload in an unknown parameter
#      must not be reflected, so a generic reflector is not reported (QoD 75).
#   3. SQLi: GET service/profil.php?link=<n>' — a MySQL syntax error in the
#      reply, while the control link=<n> carries none (QoD 75, error-based).
#
# Improvements over the source NASL: the NASL (safe_checks off) only echoes a
# fixed alert(document.cookie) string and never tests the SQL injection; its
# safe mode is a version comparison. The feed uses a random marker, a
# reflector control, and an error-based proof for the SQLi.
#
# CVSS: CVE-2008-5214 v2 4.3, CVE-2008-5215 v2 7.5 (NVD has no v3 scores).
#
# Ported from OpenVAS/Greenbone NVT 2008/gb_clanlite_sql_inj_n_xss_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.800145, GPL-2.0-only).
uid: c87000a6-f68b-4a1f-a0c3-56545b05986d
name: "ClanLite calendrier.php XSS and profil.php SQL Injection (CVE-2008-5214, CVE-2008-5215)"
description: |
  Tests ClanLite (2.2006.05.20 and earlier) for two flaws. Under /clanlite and
  in the web root, once service/index_pri.php shows the ClanLite page title,
  the feed sends the annee parameter of service/calendrier.php a quote and a
  script element that only carries a random marker, and reports the reflected
  cross-site scripting when that exact element comes back unescaped; a control
  request with the same payload in an unknown parameter must not reflect it.
  It then sends the link parameter of service/profil.php a single quote and
  reports the SQL injection when the reply contains a MySQL syntax error that
  a numeric link does not produce. Nothing is read or changed, and the script
  only reaches the scanner.
cves: [CVE-2008-5214, CVE-2008-5215]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.30
tags: [clanlite, php, mysql, sqli, xss, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2008-5214"
  - "https://nvd.nist.gov/vuln/detail/CVE-2008-5215"
  # OpenVAS/Greenbone NASL 2008/gb_clanlite_sql_inj_n_xss_vuln.nasl (GPL-2.0-only)

steps:
  - id: gen-marker
    action: script
    code: |
      let m = "noctis" + oob_token.sub_string(0, 8) + oob_token.sub_string(9, 4);
      #{ marker: m,
         script: "<script>alert(/" + m + "/)</script>",
         payload: "%27%3E%3Cscript%3Ealert(/" + m + "/)%3C/script%3E" }
    store_as: sc

  - id: init-done
    action: set_var
    var_name: done
    var_value: false

  # ── Loop group: every step below runs once per candidate folder ───────────
  - id: init-home
    action: set_var
    var_name: home
    var_value: {status: 0, body: ""}
    loop:
      var: d
      over: ["/clanlite", ""]

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

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

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

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

  - id: fetch-home
    action: http_request
    method: GET
    path: "{{d}}/service/index_pri.php"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 15
    condition: '!done'
    store_as: home

  - id: gate
    action: script
    condition: '!done'
    code: |
      let b = if type_of(home.body) == "string" { home.body } else { "" };
      home.status == 200 && b.contains("<title>ClanLite")
    store_as: is_cl

  # ── XSS ───────────────────────────────────────────────────────────────────
  - id: xss-probe
    action: http_request
    method: GET
    path: "{{d}}/service/calendrier.php?mois=6&annee={{sc.payload}}"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 15
    condition: '!done && is_cl'
    store_as: xr

  - id: xss-control
    action: http_request
    method: GET
    path: "{{d}}/service/calendrier.php?mois=6&annee=2006&{{sc.marker}}={{sc.payload}}"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 15
    condition: '!done && is_cl && xr.status == 200 && xr.body.contains(sc.script)'
    store_as: cr

  - id: xss-verdict
    action: script
    condition: '!done && is_cl'
    code: |
      let xb = if type_of(xr.body) == "string" { xr.body } else { "" };
      let cb = if type_of(cr.body) == "string" { cr.body } else { "" };
      if xr.status == 200 && xb.contains("'>" + sc.script) && cr.status != 0 && !cb.contains(sc.script) { "yes" } else { "" }
    store_as: xss_hit

  - id: report-xss
    action: match
    source: xss_hit
    pattern: "^yes$"
    condition: '!done && is_cl'
    on_match:
      finding:
        title: "ClanLite calendrier.php annee Reflected Cross-Site Scripting (CVE-2008-5214)"
        description: "An unauthenticated request to ClanLite service/calendrier.php with the annee parameter set to a quote and a script element carrying a random marker returned that script element unescaped; the same payload in an unknown parameter was not reflected. An attacker can send a victim a link that runs any script in the site's origin."
        remediation: "No fixed ClanLite release is known. Remove or restrict the application, or HTML-escape annee (cast it to an integer) before printing it."
        cves: [CVE-2008-5214]
        cvss: 4.3
        severity: medium
        confidence_delta: 0.45
        qod: 75
        evidence: "{{d}}/service/calendrier.php?mois=6&annee='><script>alert(/{{sc.marker}}/)</script> was reflected unescaped; the same payload in an unknown parameter was not"

  # ── SQL injection (error-based) ───────────────────────────────────────────
  - id: sqli-probe
    action: http_request
    method: GET
    path: "{{d}}/service/profil.php?link=1%27"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 15
    condition: '!done && is_cl'
    store_as: sr

  - id: sqli-control
    action: http_request
    method: GET
    path: "{{d}}/service/profil.php?link=1"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 15
    condition: '!done && is_cl'
    store_as: br

  - id: sqli-verdict
    action: script
    condition: '!done && is_cl'
    code: |
      let sb = if type_of(sr.body) == "string" { sr.body } else { "" };
      let bb = if type_of(br.body) == "string" { br.body } else { "" };
      let pat = "(You have an error in your SQL syntax|supplied argument is not a valid MySQL)";
      if sr.status != 0 && br.status != 0 && egrep(pat, sb) != "" && egrep(pat, bb) == "" { "yes" } else { "" }
    store_as: sqli_hit

  - id: report-sqli
    action: match
    source: sqli_hit
    pattern: "^yes$"
    condition: '!done && is_cl'
    on_match:
      finding:
        title: "ClanLite profil.php link SQL Injection (CVE-2008-5215)"
        description: "An unauthenticated request to ClanLite service/profil.php with a single quote appended to the link parameter returned a MySQL syntax error, while the same request with a plain number did not. The parameter reaches an SQL query unescaped, so an attacker can read or change the database."
        remediation: "No fixed ClanLite release is known. Remove or restrict the application, or cast link to an integer or use prepared statements."
        cves: [CVE-2008-5215]
        cvss: 7.5
        severity: high
        confidence_delta: 0.45
        qod: 75
        evidence: "{{d}}/service/profil.php?link=1' returned a MySQL syntax error; link=1 did not"

  - id: mark-done
    action: script
    condition: '!done && is_cl'
    code: "true"
    store_as: done

View these feeds on GitHub