/

CVE-2026-39331

Severity:

HIGH RISK

(8.1)

Broken Access Control / Insecure Direct Object Reference

CVE-2026-39331

Analyzed

Vulnerability type

Category:

Broken Access Control / Insecure Direct Object Reference

CWE:

CWE-639, CWE-863

Impact:

Unauthorized Modification of Application Data and Workflow State

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's family management API endpoints allow authenticated users to modify the state of any family record by tampering with the {familyId} parameter, even when they lack the necessary EditRecords privilege.

This broken object-level authorization lets users deactivate or reactivate families, spam verification emails, mark families as verified, and trigger geocoding for arbitrary family records under normal authenticated usage conditions.

Affected context

The vulnerability exists in ChurchCRM deployments where:

  • The application exposes family management endpoints such as:
  • POST /family/{familyId}/verify
  • POST /family/{familyId}/verify/url
  • POST /family/{familyId}/verify/now
  • POST /family/{familyId}/activate/{status}
  • POST /family/{familyId}/geocode
  • Any authenticated API user can call these endpoints.
  • Authorization checks verify authentication but do not verify that the caller:
  • Owns the targeted family record, or
  • Holds a role/permission (such as EditRecords) appropriate for that record.

In such environments, the API treats the familyId path parameter as trusted input without binding it to the caller's effective permissions.

Exploit preconditions

  • Attack surface: Authenticated HTTP(S) API endpoints in the ChurchCRM web application.
  • Required access: Any valid authenticated account with API access; elevated roles are not required.
  • Attacker capabilities: Ability to intercept or craft HTTP requests and change the {familyId} (and {status}) path parameter values.
  • Trigger point: Invocation of vulnerable endpoints:
  • /family/{familyId}/verify
  • /family/{familyId}/verify/url
  • /family/{familyId}/verify/now
  • /family/{familyId}/activate/{status}
  • /family/{familyId}/geocode
  • Why exploitation is possible: The application checks that the user is logged in but fails to enforce record-level authorization or role-based access control on the targeted family resource, allowing direct object reference manipulation.

Why this happens

This issue stems from broken object-level authorization, where the API trusts client-supplied identifiers without confirming that the caller is authorized to act on the referenced object.

Specifically, endpoints operating on familyId:

  • Perform authentication, but
  • Do not consistently:
  • Check whether the user has the EditRecords privilege or equivalent rights, or
  • Validate ownership or scope of access for the targeted family.

This maps to:

  • CWE-639: Authorization Bypass Through User-Controlled Key – because the resource key (familyId) is directly controlled by the client.
  • CWE-863: Incorrect Authorization – due to incomplete or missing authorization checks on privileged operations (activation, verification, geocoding).

Abstractly, the insecure pattern is: "Any authenticated user can invoke state-changing operations on arbitrary resources by guessing or enumerating identifiers, because authorization is not enforced at the object level."

Potential impact

  • Authenticated users may deactivate or reactivate arbitrary family records, disrupting normal operations.
  • Users can mark families as verified without appropriate authorization, undermining data integrity and trust in verification workflows.
  • Attackers can spam verification emails to targeted families by repeatedly calling verification-related endpoints.
  • Uncontrolled geocoding requests can be triggered for arbitrary families, potentially increasing external service usage or exposing location-related metadata in unintended ways.
  • Combined with other weaknesses (e.g., enumeration of valid IDs), an attacker can systematically manipulate large portions of the family database.

General mitigation guidance

Effective mitigation focuses on enforcing consistent, centralized authorization for every operation that targets a specific resource:

  • Enforce object-level authorization on every endpoint:
  • For each family-related action, validate that the caller is allowed to operate on that specific familyId (e.g., via ownership checks or role-based permissions).
  • Tie business operations (verify, activate/deactivate, geocode) to explicit privileges such as EditRecords or dedicated, narrowly scoped permissions.
  • Centralize access control logic:
  • Use shared middleware, decorators, or policy layers so that all resource-handling endpoints automatically enforce authorization rather than relying on per-endpoint ad hoc checks.
  • Constrain actions by business rules:
  • Limit who may send verification emails or change verification status, and rate-limit repeated actions on the same record.
  • Restrict activation/deactivation operations to administrative or staff roles.
  • Avoid trusting client-supplied identifiers by default:
  • Treat IDs in the path or query as untrusted and always pair them with server-side checks that confirm relationship and permissions before performing any state changes.
  • Apply least privilege:
  • Ensure accounts and API tokens are granted only the minimum capabilities needed, and avoid giving generic authenticated users broad modification rights.

How teams detect issues like this

Detection typically combines code-centric and behavioral approaches:

  • Static and code review checks:
  • Identify all controllers/handlers that accept familyId as input and review whether they consistently call a central authorization routine.
  • Use static analysis or custom linters to flag endpoints that:
  • Modify or verify resources without invoking permission checks, or
  • Only check authentication but not object-level authorization.
  • Policy and framework enforcement:
  • Adopt a policy-based access control framework (e.g., RBAC/ABAC) that forces developers to declare required permissions per endpoint.
  • Configure automated review tools to highlight new routes that bypass the shared authorization mechanism.
  • Runtime monitoring and logging:
  • Log calls to sensitive endpoints (/family/*/activate, /family/*/verify, /family/*/geocode) including caller identity and target familyId.
  • Monitor for patterns such as:
  • A single low-privilege account modifying many different families.
  • Repeated verification or geocode requests on multiple records from the same user or IP.
  • Testing and security validation:
  • Include authorization tests in CI that attempt to access or modify records belonging to other users or groups using standard accounts.
  • Perform regular penetration tests focusing on IDOR and broken access control patterns for all resource-based routes.

Sources

SourceLink
github.comgithub.com/ChurchCRM/CRM/security/advisories/GHSA-vwh8-x823-wjc5

Frequently asked

questions

Exploitation is straightforward for anyone with a valid account. An attacker can intercept or craft API requests and change the {familyId} (and optionally {status}) in the URL to operate on other families' records without needing advanced skills.

No. Any authenticated API user can potentially exploit the vulnerability. The weakness lies in the absence of object-level authorization checks on the affected endpoints, not in misconfigured admin permissions.

Implement consistent, centralized authorization checks for every resource-specific operation. Each API endpoint that accepts an ID should verify that the caller has explicit permission to act on that specific resource, using a shared policy or authorization layer rather than endpoint-specific ad hoc logic.

Adopt a defense-in-depth strategy: design APIs with "deny by default," enforce RBAC/ABAC at a central layer, require tests for horizontal and vertical privilege escalation, and use automated tools to detect endpoints that modify resources without invoking common authorization routines.

Find out what's already
exploitable in your codebase.