/

CVE-2026-39319

Severity:

HIGH RISK

(8.8)

SQL Injection in ChurchCRM FundRaiser Editor Endpoint

CVE-2026-39319

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Arbitrary SQL Execution / 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

ChurchCRM contains a second-order SQL injection vulnerability in the /FundRaiserEditor.php endpoint, where data previously stored in a PHP session parameter is later used unsafely in SQL queries.

An authenticated but otherwise low-privilege user can inject arbitrary SQL via the iCurrentFundraiser session value and subsequently trigger it to extract or modify data in the ChurchCRM database.

Affected context

The vulnerability occurs in ChurchCRM deployments that:

  • Use the /FundRaiserEditor.php endpoint,
  • Store user-controlled values (such as iCurrentFundraiser) in PHP session state, and
  • Later incorporate those values into SQL statements without proper sanitization, parameterization, or validation.

It becomes especially risky in environments where authenticated users are common and session data flows into privileged database operations without strict checks.

Exploit preconditions

  • Attack surface: HTTP(S) requests to the /FundRaiserEditor.php endpoint in a deployed ChurchCRM instance.
  • Required access: Valid authenticated user account; no special roles or elevated privileges are required.
  • Trigger point: SQL queries that read the iCurrentFundraiser value from the PHP session and concatenate it directly into SQL statements.
  • Why exploitation is possible: The application assumes data in the session is trusted and does not re-validate or parameterize it before using it in database operations, allowing previously injected content to execute as part of a later query.

Why this happens

This issue is a classic second-order SQL injection problem aligned with CWE-89: Improper Neutralization of Special Elements used in an SQL Command.

Instead of directly using request parameters in SQL, the application stores a user-controlled value (iCurrentFundraiser) in the PHP session and later constructs SQL queries by concatenating this value into the query string.

Because session data is treated as inherently trusted and is not passed through parameterized queries or robust validation at the point of use, attacker-controlled SQL fragments can execute during subsequent operations involving the fundraiser data.

Potential impact

  • An authenticated user could read sensitive data from ChurchCRM tables, including personal or financial records.
  • An attacker may modify or delete fundraising or related records, impacting data integrity.
  • SQL injection could be used to escalate access within the application by altering permission or account data.
  • In certain configurations, database-level compromise may enable further lateral movement in the environment.

General mitigation guidance

Effective mitigation focuses on treating all persisted data as potentially untrusted and enforcing safe database interaction patterns:

  • Use parameterized queries or prepared statements for all SQL interactions, including those using values sourced from sessions or other server-side storage.
  • Normalize and validate identifiers such as fundraiser IDs (e.g., enforcing numeric types, whitelisting known values) before interacting with the database.
  • Apply a clear separation between data and SQL logic, avoiding dynamic SQL string concatenation wherever possible.
  • Reduce the trust level of session data by re-validating its contents against expected schemas or domain rules before use in sensitive operations.
  • Apply least-privilege to database accounts so that the web application can perform only the minimum required operations, limiting the blast radius of any injection.

How teams detect issues like this

Organizations can detect similar issues by:

  • Running static analysis with rules targeting dynamic SQL construction, especially where session variables, request parameters, or other user-influenced data flow into query strings.
  • Reviewing code paths where values are written to and later read from sessions, cookies, or persistent storage, checking that parameterization is enforced at the point of query execution.
  • Applying secure coding guidelines and linting policies that forbid ad-hoc string concatenation for SQL and require prepared statements.
  • Using application security testing (DAST/IAST) tools configured to exercise authenticated workflows and look for second-order injection patterns that manifest only after multiple requests.

Sources

SourceLink
github.comgithub.com/ChurchCRM/CRM/security/advisories/GHSA-vg4m-hc29-jgqj

Frequently asked

questions

Yes. Any user who can authenticate to the ChurchCRM application and reach the affected endpoint over the network can potentially exploit this issue, even without elevated privileges.

The attacker needs a valid authenticated account but does not require administrative or special roles. Low-privilege or default user accounts are sufficient if they can influence the iCurrentFundraiser session parameter.

Adopt parameterized queries everywhere, especially at the point where data is used in SQL. Treat session and other server-side stored values as untrusted, apply strict validation or casting (e.g., integer IDs), and avoid constructing SQL using string concatenation.

Establish coding standards that mandate prepared statements for all database access, incorporate static analysis checks for SQL concatenation, and perform architectural reviews of data flows where user input is stored and later reused. Training developers on second-order injection patterns and enforcing secure design reviews for data persistence layers further reduces the likelihood of recurrence.

Find out what's already
exploitable in your codebase.