Summary
An SQL injection vulnerability in ChurchCRM's /PropertyTypeEditor.php endpoint allows authenticated users with the isMenuOptionsEnabled role to inject arbitrary SQL via the Name and Description parameters.
Under these conditions, an attacker can craft malicious input to read, modify, or delete data in the application's database.
Affected context
This vulnerability appears in ChurchCRM deployments where:
- The
/PropertyTypeEditor.phpendpoint is accessible to authenticated users with theisMenuOptionsEnabledpermission. - User-supplied
NameandDescriptionfields are incorporated into SQL queries. - Input is handled through string concatenation or otherwise unsafely bound into SQL statements without rigorous parameterization or escaping.
The issue is limited to contexts where role-based access grants use of this endpoint, but within that scope, the database layer is exposed to crafted SQL.
Exploit preconditions
- Attack surface: HTTP(S) interface of ChurchCRM, specifically the
/PropertyTypeEditor.phpendpoint. - Required access: Valid ChurchCRM account with the
isMenuOptionsEnabledrole (or equivalent permission granting access to the property type editor). - Trigger point: Submission of specially crafted values in the
NameandDescriptionparameters through forms or direct HTTP requests. - Why exploitation is possible: The application constructs SQL queries using these parameters without consistently using prepared statements or safe query builders, allowing attacker-controlled input to alter the intended SQL structure.
Why this happens
The core issue is improper neutralization of user input before it is embedded in SQL queries, mapping directly to CWE-89: Improper Neutralization of Special Elements used in an SQL Command.
Instead of using parameterized queries or an abstraction that separates data from query syntax, the implementation likely concatenates or interpolates the Name and Description values into a query string.
This pattern allows attacker-controlled characters (such as quotes, operators, and comment markers) to break out of the intended value context and inject additional SQL logic, affecting both data retrieval and modification.
Potential impact
- Authenticated users with the relevant role may extract sensitive data from arbitrary tables.
- Attackers could modify or delete existing records, impacting data integrity.
- New records may be created with malicious or misleading content.
- Application behavior could be manipulated by altering configuration or permission-related data stored in the database.
- In some environments, SQL injection could be a stepping stone to broader system compromise (e.g., via database-specific features or chained vulnerabilities).
General mitigation guidance
Effective mitigation centers on separating data from SQL logic and reducing trust in user-supplied input:
- Use parameterized queries or prepared statements for all database interactions involving user input, including
NameandDescriptionfields. - Adopt an ORM or query builder that enforces binding parameters rather than composing raw SQL strings.
- Apply strict server-side validation and normalization to ensure these fields conform to expected formats and lengths.
- Minimize the privileges of the database user account used by ChurchCRM so injected queries are constrained in what they can access or modify.
- Restrict high-impact roles like
isMenuOptionsEnabledto the smallest set of users and regularly review role assignments.
These patterns help ensure that even if input is malicious, it cannot change the structure of executed SQL statements.
How teams detect issues like this
Organizations can identify and monitor for this class of issue using multiple approaches:
- Static analysis: Configure SAST tools or custom linters to flag dynamic SQL construction (e.g., string concatenation or interpolation) involving request parameters or form fields.
- Code review: During manual reviews, pay attention to database access layers, looking for any use of raw SQL that includes variables derived from HTTP input without binding.
- Dynamic testing: Employ DAST or targeted penetration tests that send SQL meta-characters in
NameandDescriptionfields, observing for errors, unusual responses, or evidence of data leakage. - Runtime monitoring: Monitor database logs for anomalous queries generated from the application context, such as ones containing unexpected comment markers, always-true conditions, or stacked statements.
Automated review tools can be integrated into CI/CD pipelines to enforce safe query construction patterns before deployment.

