/

CVE-2026-40581

Severity:

HIGH RISK

(8.1)

CSRF in ChurchCRM Family Deletion Endpoint

CVE-2026-40581

Deferred

Vulnerability type

Category:

Cross-Site Request Forgery (CSRF)

CWE:

CWE-352, CWE-862

Impact:

Unauthorized Data Deletion and Integrity Loss

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

ChurchCRM versions prior to 7.2.0 expose a family record deletion endpoint that performs irreversible deletion of families and all associated data via a simple GET request without CSRF protection.

An attacker can lure an authenticated administrator to a crafted web page that silently issues deletion requests, resulting in unintended loss of notes, pledges, person records, and property data without any explicit confirmation or interaction.

Affected context

The vulnerability occurs in the ChurchCRM family record deletion workflow, specifically in the SelectDelete.php endpoint responsible for permanent family removal.

It is relevant in deployments where:

  • Administrators manage family records through a browser session
  • The application exposes state-changing operations (like delete) over plain GET requests
  • CSRF tokens or equivalent request-origin checks are not enforced for destructive actions

Under these conditions, a browser visiting an attacker-controlled page can unknowingly issue valid deletion requests while still authenticated to ChurchCRM.

Exploit preconditions

  • Attack surface: Web application endpoint SelectDelete.php accepting GET requests to delete families
  • Required access: Attacker does not need direct ChurchCRM access, but the victim must be an authenticated administrator with permission to delete families
  • Trigger point: Victim visits an attacker-controlled page (or embedded resource) while logged into ChurchCRM, causing the browser to auto-send the crafted GET request
  • Why exploitation is possible:
  • The deletion action is mapped to a simple, side-effecting GET request
  • No CSRF token or origin validation is required for the request
  • The browser automatically includes the victim's session cookies, making the request appear legitimate to the server

Why this happens

The core issue is a missing CSRF defense on a high-impact, state-altering operation, combined with the misuse of HTTP GET for a destructive action.

This maps to CWE-352: Cross-Site Request Forgery (CSRF), where the application trusts any request bearing valid authentication cookies without verifying user intent or request origin.

Additionally, the absence of robust authorization checks per action (CWE-862) can exacerbate the risk if role-based verification on delete operations is weak or inconsistently enforced.

At an abstract level, the pattern is: "browser-authenticated state changes are performed solely based on session cookies, without any user-specific, non-replayable confirmation token, and are exposed via idempotent-looking endpoints."

Potential impact

  • Irreversible deletion of family records without the administrator's knowledge
  • Loss of associated notes, pledges, person records, and property data
  • Integrity corruption of membership and financial records
  • Operational disruption for organizations relying on ChurchCRM data for day-to-day activities
  • Potential compliance or audit issues due to missing or incomplete historical records

General mitigation guidance

Mitigations generally focus on enforcing strong CSRF protections and aligning HTTP semantics with security expectations.

Recommended defensive patterns include:

  • Requiring cryptographically strong, per-session or per-request CSRF tokens on all state-changing operations, especially destructive ones
  • Restricting deletion and similar critical actions to POST (or other non-GET methods) and validating content type and origin where feasible
  • Introducing explicit user confirmation steps (e.g., confirmation pages or dialogs) for irreversible deletions
  • Ensuring fine-grained authorization checks on each sensitive operation so only appropriately privileged roles can trigger them
  • Applying defense-in-depth measures such as SameSite cookies and origin/referrer checks to make cross-site triggering harder

Designing destructive endpoints to be "hard to call accidentally" and "hard to call cross-site" significantly reduces the attack surface.

How teams detect issues like this

Effective detection centers on identifying unprotected, state-changing endpoints and validating that CSRF controls are consistently applied.

Possible approaches:

  • Static analysis rules that flag:
  • State-changing operations (e.g., delete/update actions) exposed over HTTP GET
  • Form handlers or controllers that modify server-side state without checking a CSRF token or similar nonce
  • Code review checklists that explicitly require:
  • Verification of CSRF defenses on all create/update/delete endpoints
  • Confirmation that HTTP methods align with REST and security best practices
  • Automated tests or security scanners that:
  • Attempt cross-origin requests to known sensitive endpoints and verify whether they are accepted without anti-CSRF tokens
  • Configuration and policy enforcement in CI/CD pipelines to prevent merging of new endpoints lacking documented CSRF handling

Sources

SourceLink
github.comgithub.com/ChurchCRM/CRM/commit/39361628613af7682b813f3e62a412559616d674
github.comgithub.com/ChurchCRM/CRM/pull/8613
github.comgithub.com/ChurchCRM/CRM/security/advisories/GHSA-6qxv-xw9j-77pj

Frequently asked

questions

Yes, in the sense that an attacker can host a malicious page anywhere on the internet. If an authenticated ChurchCRM administrator visits that page while logged in, their browser can send forged deletion requests to the ChurchCRM instance, provided it is reachable from their network.

The attacker does not need direct access to ChurchCRM. However, exploitation depends on a victim who:

  • Is logged in to ChurchCRM with a role capable of deleting families, and
  • Visits attacker-controlled content (e.g., a website, email with HTML content, or embedded resource) that issues the crafted request.

The safest pattern is to:

  • Require non-guessable CSRF tokens for all state-changing actions
  • Use HTTP POST (or other non-GET verbs) for destructive endpoints
  • Add explicit confirmation flows for irreversible operations

Together, these ensure actions cannot be triggered silently by cross-site content.

Prevention relies on consistent application of secure design patterns:

  • Adopt a framework-level CSRF protection mechanism and enforce it by default on all mutating routes
  • Establish coding standards that disallow destructive actions over GET and require documented CSRF checks
  • Include CSRF coverage in automated tests and security reviews
  • Periodically audit sensitive endpoints (delete, update, financial operations) to verify they adhere to these standards.
Find out what's already
exploitable in your codebase.