/

CVE-2026-39341

Severity:

HIGH RISK

(8.1)

SQL Injection in ChurchCRM Confirm Report Email Endpoint

CVE-2026-39341

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Data Exfiltration and Integrity Compromise via SQL Injection

Severity:

HIGH RISK

(8.1)

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 time-based SQL injection vulnerability in ChurchCRM allows crafted input to the Reports/ConfirmReportEmail.php?familyId= parameter to modify database queries through unsanitized user data.

When exploited, this can enable attackers to infer or manipulate sensitive data by abusing database response timing, especially in deployments where the endpoint is exposed to untrusted users.

Affected context

This vulnerability occurs in ChurchCRM deployments that expose the Reports/ConfirmReportEmail.php endpoint and accept the familyId parameter from user-controlled sources.

The issue is triggered when user input passes through a sanitization step, but the sanitized value is not actually used in the query construction, leaving the raw parameter to influence SQL statements.

It is most relevant in environments where attackers can reach this endpoint over the network without strong input validation or strict access controls.

Exploit preconditions

  • Attack surface: HTTP(S) interface of the ChurchCRM application, specifically Reports/ConfirmReportEmail.php?familyId=.
  • Required access: Ability to send requests to the vulnerable endpoint (e.g., authenticated or unauthenticated depending on deployment configuration).
  • Trigger point: Database operations performed when ConfirmReportEmail.php processes the familyId parameter and constructs an SQL query.
  • Why exploitation is possible: The application performs input validation or sanitization but fails to use the sanitized value when building the SQL query, allowing the original user-supplied familyId to alter the SQL logic. Time-based payloads can then be used to infer data based on response delays.

Why this happens

The root cause aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

Instead of binding user input via parameterized queries, the endpoint constructs SQL statements in a way that allows user-controlled data from familyId to be concatenated into the query.

Although there is an attempt to sanitize the input, the sanitized variant is not used in the actual query creation, effectively bypassing the defensive step and leaving the database call vulnerable to injection and timing-based inference.

Potential impact

  • Attackers may extract sensitive information from database tables by using time-based blind SQL techniques.
  • Malicious actors could modify or corrupt stored data, affecting records related to families, members, or other church management information.
  • Application behavior could be altered by manipulating query conditions, impacting report generation or email confirmation workflows.
  • In some configurations, attackers might be able to escalate to broader database compromise if additional flaws or weak permissions are present.

General mitigation guidance

Effective mitigation focuses on eliminating direct string concatenation of user input into SQL and ensuring that any transformation or validation is consistently applied.

Recommended defensive patterns include:

  • Using parameterized queries or prepared statements for all database access, with placeholders for user-supplied values.
  • Ensuring that the sanitized or validated variant of user input is the only value passed into the query-building layer.
  • Applying strict server-side validation and type enforcement (e.g., treating familyId as an integer and rejecting non-conforming input).
  • Centralizing database access patterns in a data access layer that enforces secure query construction by default.
  • Limiting database privileges of the application account to only the operations and tables required for normal use.

How teams detect issues like this

Detection typically combines code-focused reviews with runtime testing:

  • Static analysis: Use rules that flag dynamic SQL construction with user-controlled variables, particularly concatenation involving request parameters such as familyId.
  • Code review: Look for instances where input is sanitized but the sanitized variable is not actually used in the executed query; verify that prepared statements are consistently applied.
  • Dynamic testing: Perform time-based SQL injection tests on endpoints that use numeric or identifier parameters, monitoring for measurable response delays correlated with crafted inputs.
  • Policy enforcement: Introduce development guidelines and automated checks that require parameterized queries and prohibit ad-hoc string-based query construction.

Sources

SourceLink
github.comgithub.com/ChurchCRM/CRM/security/advisories/GHSA-3h69-vjff-jj5c

Frequently asked

questions

It can be highly exploitable when the endpoint is reachable by untrusted users and the database responds consistently to time-based probes. Even without direct data error messages, attackers can infer data via response timing differences.

That depends on how the ChurchCRM instance is configured. If Reports/ConfirmReportEmail.php is accessible without strong authentication or is exposed to lower-privileged users, those users could exploit the vulnerability.

The safest pattern is to refactor the vulnerable code to use parameterized queries or prepared statements exclusively, passing only typed, validated parameters into the SQL layer and avoiding any string concatenation of user input.

Adopt a secure data access layer that enforces prepared statements by default, apply strict server-side validation for all query inputs, and integrate static analysis and security-focused code review into the development lifecycle to catch unsafe query patterns early.

Find out what's already
exploitable in your codebase.