/

CVE-2026-39325

Severity:

HIGH RISK

(7.2)

SQL Injection in ChurchCRM /SettingsUser.php Endpoint

CVE-2026-39325

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Authenticated SQL Injection leading to data exposure and modification

Severity:

HIGH RISK

(7.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

An SQL injection vulnerability in ChurchCRM's /SettingsUser.php endpoint allows authenticated administrative users to inject arbitrary SQL statements via the type array parameter index.

Under certain conditions, this can be used to read, modify, or delete data in the ChurchCRM database and potentially impact the integrity and confidentiality of stored church records.

Affected context

This vulnerability occurs in ChurchCRM deployments using version 7.0.5 (and likely nearby versions prior to 7.1.0) where the /SettingsUser.php endpoint is accessible to logged-in administrative users.

It specifically affects request paths that accept a type array parameter whose index value is incorporated into SQL queries without robust sanitization or parameterization.

The risk is present in environments where admin accounts are widely used, shared, or insufficiently protected, and where the application database contains sensitive member, contribution, or operational data.

Exploit preconditions

  • Attack surface: HTTP(S) requests to the /SettingsUser.php endpoint within ChurchCRM.
  • Required access: Valid authenticated administrative user account (or equivalent privileges that can call the affected functionality).
  • Trigger point: Submission of crafted input in the type array parameter index, causing the backend to interpolate untrusted data into SQL statements.
  • Why exploitation is possible: The server-side code uses the type array index directly in SQL construction without using parameterized queries or adequate validation/escaping, allowing an attacker-controlled fragment to alter the structure of the SQL query.

Why this happens

The root cause aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

The endpoint logic builds SQL queries dynamically, incorporating user-controlled data from the type array parameter index.

Instead of using parameterized queries or strict whitelisting of allowed values, the implementation likely concatenates or interpolates the input directly into the query text.

This pattern allows crafted input to break out of the intended query context and inject additional SQL operations, turning untrusted input into executable database commands.

Potential impact

  • Unauthorized reading of sensitive data stored in the ChurchCRM database (e.g., member records, contributions, contact information).
  • Modification of configuration settings or user-related data, potentially impacting application behavior.
  • Insertion, update, or deletion of database records, leading to data tampering or loss.
  • Escalation of impact if combined with other weaknesses (e.g., use of powerful database accounts, weak separation of duties).
  • Potential for staging further attacks if the database contents are used for authentication or application logic decisions.

General mitigation guidance

Effective mitigation focuses on eliminating dynamic SQL construction from user-controllable input and hardening the privilege context in which queries execute.

Recommended defensive patterns include:

  • Using parameterized queries or prepared statements for all database access, ensuring user-supplied values are bound as data, not as query structure.
  • Applying strict whitelisting for any dynamic elements that must influence query structure (such as column or setting names), mapping user input to a fixed, vetted set of server-side constants.
  • Normalizing input handling of array parameters so that indices and keys are validated against expected formats and value sets before use.
  • Enforcing least-privilege database credentials so that the application account only has the minimal permissions required for normal operation.
  • Introducing centralized database access layers or ORM patterns that discourage ad-hoc string concatenation and encourage safe query patterns by default.

How teams detect issues like this

Organizations can surface this class of issue using a mix of review and automation:

  • Static analysis: Configure rules to flag direct string concatenation or interpolation involving request parameters (e.g., $_GET, $_POST, $_REQUEST, or framework input objects) in SQL query construction.
  • Code review: During manual review, trace how the type parameter and similar user-controlled inputs propagate into database calls, looking for unparameterized query assembly and missing validation.
  • Dynamic testing: Use application-aware security testing (DAST) to send crafted payloads to the /SettingsUser.php endpoint and monitor for SQL errors, response anomalies, or unexpected behavior.
  • Policy enforcement: Adopt secure coding guidelines that mandate prepared statements and whitelisting for all dynamic query elements, and enforce these policies via pre-commit hooks or CI checks.

Sources

SourceLink
github.comgithub.com/ChurchCRM/CRM/security/advisories/GHSA-cf68-g7vf-9xrq

Frequently asked

questions

It can be, if the ChurchCRM instance is exposed over the internet and an attacker can obtain or abuse administrative credentials. The vulnerability itself is in a web endpoint and is exploitable via crafted HTTP requests once authenticated.

Yes, according to the description exploitation requires an authenticated administrative user. However, the risk remains significant if admin accounts are compromised, shared, or lack strong authentication controls.

Refactor the affected code to use parameterized queries or a safe ORM-based data access layer, and ensure that any dynamic elements (such as configuration keys or setting names) are derived from a server-side whitelist rather than directly from request parameters.

Adopt a "no raw SQL concatenation" policy, mandate prepared statements for all user-influenced queries, validate and constrain all user input (especially array indices and keys), and incorporate automated security checks (static analysis and targeted security tests) into the development and review lifecycle.

Find out what's already
exploitable in your codebase.