/

CVE-2026-39323

Severity:

HIGH RISK

(8.8)

SQL Injection in ChurchCRM PropertyTypeEditor.php

CVE-2026-39323

Received

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL Execution and Data Compromise

Severity:

HIGH RISK

(8.8)

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

A SQL injection vulnerability in ChurchCRM's PropertyTypeEditor.php allows crafted Name and Description values to be concatenated directly into SQL queries after only minimal sanitization.

Authenticated users with "Manage Properties" permissions can leverage this flaw to execute arbitrary SQL commands, potentially exfiltrating, modifying, or deleting application data and causing persistent, application-wide impact.

Affected context

This vulnerability occurs in ChurchCRM installations where the PropertyTypeEditor.php endpoint processes POST requests to create or edit property types.

The issue manifests when:

  • The Name and Description fields are accepted from the client,
  • The input is sanitized only with strip_tags() (removing HTML but not SQL control characters),
  • The resulting values are concatenated directly into SQL statements without parameterization.

It primarily affects environments where authenticated users are granted the "Manage Properties" permission and the application connects to a relational database using these unsafe queries.

Exploit preconditions

  • Attack surface: Web application interface handling Property Type creation/editing (PropertyTypeEditor.php).
  • Required access: Authenticated user with "Manage Properties" permission or equivalent capability to submit Name and Description POST parameters.
  • Trigger point: Submission of malicious values for Name and/or Description through HTTP POST, which are then embedded in SQL without parameter binding.
  • Why exploitation is possible: Input is only sanitized via strip_tags(), which does not neutralize SQL meta-characters or query structure.

The application constructs SQL queries by string concatenation instead of using prepared statements, enabling attacker-controlled fragments to alter query logic.

Why this happens

The underlying bug is the direct embedding of user-supplied input into SQL queries without proper query parameterization or escaping.

Relying on strip_tags() addresses HTML and script markup but does nothing to prevent SQL metacharacters (quotes, operators, delimiters) from influencing query structure.

This maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where untrusted data is used to construct SQL statements dynamically rather than being treated as data via prepared statements or bound parameters.

Potential impact

  • Attackers with the required permissions may execute arbitrary SQL commands against the ChurchCRM database.
  • Sensitive data, including member records or internal configuration data, could be exfiltrated.
  • Database records may be modified, corrupted, or deleted, affecting operational integrity.
  • Malicious data can be injected and stored, potentially leading to persistent tampering of application content.
  • Because injected content is reflected without output encoding, secondary impacts such as stored cross-site scripting could become possible in some views.

General mitigation guidance

Effective mitigation centers on eliminating dynamic SQL construction with untrusted input and tightening trust boundaries around administrative features:

  • Replace string-concatenated SQL with parameterized queries or prepared statements for all Name and Description uses.
  • Apply server-side input validation for administrative fields, enforcing strict length limits and allowed character sets consistent with expected business semantics.
  • Introduce a central database access layer that discourages or technically prevents ad-hoc query concatenation.
  • Ensure all data rendered back into HTML contexts is passed through appropriate output encoding functions based on output context (HTML, attribute, JavaScript).
  • Restrict high-privilege roles such as "Manage Properties" to the minimal number of accounts and follow least-privilege principles for administrative operations.

How teams detect issues like this

Detection approaches can combine code-centric and runtime techniques:

  • Static analysis: Search for SQL construction patterns involving direct concatenation of $_POST, $_REQUEST, or other user-controlled variables, especially in PropertyTypeEditor.php and related modules.
  • Code review: Flag uses of strip_tags() or similar HTML-focused sanitization as the sole defense before database calls, and ensure all database interactions are mediated through parameterized APIs.
  • Security testing: Use automated DAST or manual penetration testing to probe PropertyTypeEditor.php with typical SQL injection payloads and monitor for error messages, response anomalies, or data leakage.
  • Database monitoring: Enable logging or anomaly detection on the database to identify unusual or malformed queries originating from the application, particularly ones that deviate from expected CRUD patterns on property-type tables.

Sources

SourceLink
github.comgithub.com/ChurchCRM/CRM/security/advisories/GHSA-vmfg-c69g-m8p8

Frequently asked

questions

Exploitability depends on how ChurchCRM is exposed. If the administrative interface and PropertyTypeEditor.php are reachable over the internet and an attacker can obtain credentials with "Manage Properties" permissions, it can be exploited remotely. In internal-only deployments, the risk is restricted to internal users or compromised internal accounts.

The attacker must be an authenticated ChurchCRM user with the "Manage Properties" permission or equivalent rights that allow submitting Name and Description parameters to PropertyTypeEditor.php. Without this role, the vulnerable code path is not normally reachable.

The most robust fix is to refactor all affected queries to use parameterized statements or a database abstraction layer that enforces bind parameters and disallows query string concatenation. Input validation should be added as a supplemental control, not as the primary safeguard.

Adopt a development standard that prohibits constructing SQL with string concatenation for any user-supplied data, mandate the use of prepared statements or ORM query builders, and integrate secure coding guidelines into code review. Complement this with automated static analysis rules to flag non-parameterized queries and continuous security testing for high-privilege endpoints.

Find out what's already
exploitable in your codebase.