/

CVE-2026-35567

Severity:

HIGH RISK

(8.8)

SQL Injection in ChurchCRM Member Role Change Handler

CVE-2026-35567

Received

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL Execution in Application Database

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

ChurchCRM versions prior to 7.1.0 contain an SQL injection vulnerability in the src/MemberRoleChange.php endpoint, where the NewRole POST parameter is incorporated into a query without proper integer validation.

An authenticated user with the ManageGroups role who knows a valid GroupID and PersonID can inject arbitrary SQL, potentially leading to data exposure, modification, or further compromise of the ChurchCRM database.

Affected context

The vulnerability occurs in ChurchCRM's group membership management functionality, specifically when changing a member's role via MemberRoleChange.php.

It is relevant in deployments where:

  • Users are granted the ManageGroups role,
  • The application talks directly to a relational database (e.g., MySQL) using dynamically constructed SQL, and
  • Input parameters such as NewRole are not strictly validated or bound as parameters.

The issue is limited to contexts where authenticated users can access the role-change action and interact with the relevant group/member records.

Exploit preconditions

  • Attack surface: HTTP POST requests to the src/MemberRoleChange.php endpoint.
  • Required access: Authenticated ChurchCRM account with ManageGroups privileges.
  • Knowledge prerequisites: Valid GroupID and PersonID values (obtainable via GroupView or PersonView pages).
  • Trigger point: Submission of a crafted NewRole POST parameter that is concatenated into an SQL query.
  • Why exploitation is possible: The server-side code incorporates NewRole directly into SQL without enforcing integer-only semantics or using parameterized queries, enabling alteration of the intended query structure.

Why this happens

This vulnerability stems from building SQL statements by concatenating user-supplied input (NewRole) into the query string without proper type enforcement or parameter binding.

Instead of treating NewRole as a strictly validated integer, the application allows arbitrary content to propagate into the SQL layer.

This maps directly to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where untrusted input is not safely parameterized, allowing attackers to modify query logic.

Potential impact

  • Disclosure of sensitive data from ChurchCRM tables, including member or group information.
  • Unauthorized modification or deletion of records (e.g., membership data, roles, group assignments).
  • Creation or alteration of application accounts or permissions if related tables are reachable.
  • Potential pivot to broader database compromise, including schema changes or persistence of malicious data.
  • Operational disruption due to corrupted or inconsistent database state.

General mitigation guidance

Effective mitigation focuses on eliminating dynamic SQL construction from user-controllable values:

  • Use parameterized queries or prepared statements for all database access, ensuring user inputs cannot alter query structure.
  • Enforce strict type validation on fields like NewRole, treating them as integers and rejecting non-numeric data early.
  • Apply centralized input validation routines for role IDs, group IDs, and person IDs to reduce the chance of inconsistent checks.
  • Implement least-privilege database accounts so that the application can only perform necessary operations, limiting damage if an injection occurs.
  • Consider implementing a server-side allowlist for acceptable role identifiers instead of trusting client-provided values.

How teams detect issues like this

Organizations can detect similar issues using a combination of review and automated checks:

  • Static analysis rules that flag string concatenation or interpolation used with SQL execution APIs, especially with request parameters like $_POST.
  • Code review checklists that require developers to justify any non-parameterized SQL and verify strict type enforcement for IDs and role values.
  • Application security tests (including dynamic scanning) that attempt to inject SQL meta-characters into numeric parameters such as NewRole.
  • Centralized logging and monitoring for anomalous SQL patterns, such as unexpected errors or queries containing injected fragments.

Sources

SourceLink
github.comgithub.com/ChurchCRM/CRM/security/advisories/GHSA-5f97-jgg4-gqwr

Frequently asked

questions

Yes, but only by authenticated users who can reach the MemberRoleChange.php functionality. It is not exploitable by unauthenticated visitors.

The attacker must have a valid ChurchCRM account with the ManageGroups role and knowledge of a valid GroupID and PersonID, both of which are typically visible from standard UI pages.

The most robust fix is to replace all dynamic SQL that incorporates user input (including NewRole) with parameterized queries and enforce strict numeric validation for all ID-like parameters.

Adopt a defensive development standard that mandates prepared statements, centralized input validation, least-privilege database accounts, and security-focused code reviews or automated checks for any new database access code.

Find out what's already
exploitable in your codebase.