Summary
A SQL injection vulnerability in ChurchCRM's /PaddleNumEditor.php endpoint allows crafted input in the PerID parameter to be interpreted as part of a database query.
Any authenticated user, even with no explicit permissions, can potentially manipulate or access sensitive data in the ChurchCRM database when this parameter is not safely handled.
Affected context
The vulnerability occurs in ChurchCRM deployments where the /PaddleNumEditor.php endpoint is exposed to authenticated users.
It specifically affects the processing of the PerID parameter, which is used to construct SQL statements without sufficient neutralization or parameterization.
Even users with accounts that have zero assigned permissions can still reach this functionality if they can log in and send requests to the affected endpoint.
Exploit preconditions
- Attack surface: HTTP(S) requests to the ChurchCRM web application, targeting
/PaddleNumEditor.php. - Required access: Valid authenticated ChurchCRM account; no special role or permissions are required.
- Trigger point: Submission of a malicious
PerIDvalue that is concatenated into an SQL query. - Why exploitation is possible: The application uses dynamic SQL construction with user-controlled input from
PerIDand does not enforce robust parameterization or escaping, enabling the attacker to alter the structure of the underlying SQL query.
Why this happens
This issue stems from building SQL queries directly from user-supplied data without using safe parameter binding.
The PerID parameter is incorporated into a query in a way that treats the input as part of the SQL syntax rather than as data.
This matches CWE-89: Improper Neutralization of Special Elements used in an SQL Command, where the application fails to neutralize or separate control characters from data, allowing attackers to inject additional clauses or statements.
Potential impact
- Access to data related to people, donations, or other sensitive records that the attacker should not see.
- Modification or deletion of database records, potentially impacting membership, giving, or attendance data.
- Escalation of privileges if the attacker can manipulate user or role tables.
- Interference with application logic that relies on database integrity, leading to inconsistent or corrupted data.
General mitigation guidance
Effective mitigation focuses on enforcing strict separation between SQL commands and user input.
Useful defensive patterns include:
- Using prepared statements with bound parameters for all database access involving user-controlled values such as
PerID. - Applying centralized database access layers or ORM abstractions that default to parameterized queries.
- Implementing input validation for identifier-like parameters, restricting them to expected formats (e.g., numeric IDs) before passing to the database.
- Applying least-privilege to the database account used by the application so that even if a query is manipulated, its capabilities are constrained.
- Adopting secure coding guidelines that forbid ad hoc string concatenation for SQL construction across the codebase.
How teams detect issues like this
Detection efforts can focus on both code and behavior:
- Static analysis rules that flag string concatenation or interpolation in SQL query creation, especially around parameters like
PerIDin PHP code. - Targeted code reviews on endpoints that handle identifiers or search parameters, looking for missing prepared statements or escaping.
- Runtime monitoring of database queries for anomalous patterns, such as unexpected
OR 1=1, UNION clauses, or stacked statements originating from web requests. - Incorporating security checks in CI pipelines that search for anti-patterns (e.g., direct
$sql = "SELECT ... $PerID ...";) and enforce coding standards for database access.

