Summary
An SQL injection vulnerability in ChurchCRM's /SettingsIndividual.php endpoint allows authenticated users to inject arbitrary SQL via the type array parameter index.
Under certain configurations, this can enable extraction and modification of database information, including potentially sensitive church and member data.
Affected context
The vulnerability occurs in ChurchCRM installations that expose the /SettingsIndividual.php endpoint and process the type array parameter without robust input handling.
It specifically affects authenticated sessions where users, even without elevated privileges, can influence the query construction by controlling array indices that are later interpolated into SQL.
The issue is present in ChurchCRM 7.0.5 and similar implementations that build SQL dynamically from request parameters.
Exploit preconditions
- Attack surface: HTTP(S) requests to the
/SettingsIndividual.phpendpoint of a ChurchCRM instance. - Required access: Valid, authenticated user account (no special permissions required).
- Trigger point: Submission of crafted values in the
typearray parameter, especially its index, which are later used to construct SQL queries. - Why exploitation is possible: The application dynamically incorporates user-controllable data into SQL statements without sufficient validation, sanitization, or parameterization, allowing the attacker-controlled input to alter the intended query structure.
Why this happens
This vulnerability stems from constructing SQL queries by concatenating or interpolating user-supplied values from the type parameter—specifically its index—directly into the query string.
Instead of treating these values as data bound to parameters, the code appears to treat them as part of the SQL syntax, enabling manipulation of conditions or entire query fragments.
This aligns with CWE-89: SQL Injection, where failure to separate code from data in database interactions allows an attacker to modify the semantics of executed SQL queries.
Potential impact
- Retrieval of sensitive data stored in the ChurchCRM database (e.g., member records, contact information, internal notes).
- Unauthorized modification of database records, including corruption or tampering with member data and configuration settings.
- Deletion of records or entire tables, potentially causing loss of operational or historical data.
- Escalation of application-level access if data such as authentication or authorization records can be manipulated.
- Potential pivot to underlying infrastructure if database credentials or other secrets are exposed.
General mitigation guidance
Effective mitigation focuses on eliminating direct incorporation of user input into SQL and enforcing strict separation between code and data:
- Use parameterized queries or prepared statements for all database operations, including those involving dynamic lists or filters derived from request parameters.
- Apply strict allowlists for any user-controlled values that influence SQL structure, such as column names, sort keys, or indices; reject or sanitize anything outside expected patterns.
- Normalize request handling so that array indices or keys are never used directly in SQL; map them to predefined, internal identifiers instead.
- Centralize database access through a data access layer that enforces safe query-building patterns and discourages ad-hoc query concatenation.
- Limit the database account's privileges to the minimum necessary to perform application tasks, reducing blast radius if an injection occurs.
How teams detect issues like this
Organizations can identify and monitor this class of issue using a combination of review and analysis techniques:
- Static analysis configured to flag string-built SQL queries, especially those that include raw request parameters or array indices.
- Targeted code reviews of endpoints that handle settings, filters, or search parameters, looking for concatenated SQL fragments and missing parameter binding.
- Web application security testing (including automated scanners) configured to send injection payloads through parameters like
type[]and observe anomalous database responses or errors. - Database-side monitoring and logging to detect unusual query patterns, such as always-true conditions, unexpected UNIONs, or DDL operations originating from the application account.
- CI/CD gates that enforce secure database access patterns via linters or policy-as-code rules.

