/

CVE-2026-39328

Severity:

HIGH RISK

(8.9)

Stored XSS in ChurchCRM Person Profile Social Fields

CVE-2026-39328

Analyzed

Vulnerability type

Category:

Stored Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Session Hijacking and Account Compromise

Severity:

HIGH RISK

(8.9)

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 stored cross-site scripting vulnerability in ChurchCRM's person profile editing feature allows users with EditSelf permission to inject JavaScript into their own social media profile fields.

When other users or administrators view the crafted profile, the malicious script executes in their browser and can exfiltrate session cookies to a remote server.

Affected context

The vulnerability occurs in ChurchCRM's person profile pages where Facebook, LinkedIn, and X profile fields are displayed back to users.

It affects deployments where:

  • Non-administrative users have the EditSelf permission,
  • User-supplied social profile fields are rendered without proper output encoding,
  • Browsers are allowed to execute inline event handlers.

The risk manifests whenever another user, including administrators, views an attacker-controlled profile.

Exploit preconditions

  • Attack surface: Web UI, person profile view pages.
  • Required access: Authenticated ChurchCRM account with EditSelf permission (no administrative role required).
  • Trigger point: Viewing the attacker's profile page where crafted social profile fields are rendered.
  • Why exploitation is possible: The application stores untrusted input from social profile fields and later injects it into the HTML DOM with event handler attributes (e.g., onfocus) without context-appropriate output encoding or filtering, enabling execution of attacker-controlled JavaScript.

Why this happens

This issue stems from improper neutralization of user-controlled data before it is included in HTML attributes on rendered profile pages.

The Facebook, LinkedIn, and X fields accept arbitrary text that is stored in the database and later interpolated directly into attribute contexts (e.g., input elements with onfocus handlers) without robust escaping, sanitization, or separation of data and code.

This aligns with CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-site Scripting), where untrusted data is treated as safe HTML/JavaScript and executed by the browser.

Potential impact

  • Theft of session cookies from administrators and other users, which may enable account takeover.
  • Execution of arbitrary JavaScript in the context of the ChurchCRM application.
  • Unauthorized actions performed on behalf of authenticated victims (e.g., changing settings, modifying records).
  • Lateral movement through the application by impersonating high-privilege users.
  • Persistent compromise scenario where any future viewer of the malicious profile is exposed.

General mitigation guidance

Effective mitigation focuses on strict separation of user data from executable code in all rendered views:

  • Apply context-aware output encoding on all user-supplied fields before inserting them into HTML, attribute, or JavaScript contexts (e.g., HTML-encoding for text nodes, attribute encoding for attributes, JavaScript encoding in scripts).
  • Avoid storing or reflecting inline event handlers derived from user input; treat user data as pure text, not markup or script.
  • Use templating frameworks or view helpers that automatically escape output by default and discourage direct HTML concatenation.
  • Enforce strong server-side validation rules for social profile fields (e.g., URL-format checks) and reject inputs that contain script-like patterns or event handler fragments.
  • Implement Content Security Policy (CSP) to reduce the blast radius of XSS by disallowing inline scripts and restricting script sources where feasible.
  • Apply least-privilege principles to application roles; if EditSelf is broadly granted, ensure it cannot indirectly lead to arbitrary script injection.

How teams detect issues like this

Organizations can identify similar XSS issues through:

  • Static analysis that flags direct insertion of user-controlled variables into HTML attributes, inline event handlers, or script blocks without encoding.
  • Code review checklists that require verification of output encoding for all user-supplied fields, especially "profile" or "bio" style inputs.
  • Dependency and framework configuration reviews to ensure templating engines are running in "escape by default" modes and that policies do not disable auto-escaping.
  • Dynamic application security testing (DAST) with automated scanners targeting profile and settings pages where user-controlled fields are reflected back.
  • Logging and monitoring of anomalous outbound HTTP requests from user browsers (e.g., unusual cookie exfiltration endpoints) as a behavioral signal of active XSS exploitation.

Sources

SourceLink
github.comgithub.com/ChurchCRM/CRM/security/advisories/GHSA-fcp5-pwvj-v7xm

Frequently asked

questions

Any authenticated user with EditSelf permission can potentially exploit it against any other user who views their profile, including administrators, making it broadly impactful in multi-user deployments.

No. The attacker only needs a regular account with the ability to edit their own profile. Administrative privileges are not required to inject the malicious payload.

Treat all user-supplied fields as untrusted and apply strict, context-appropriate output encoding before rendering them. Remove or refactor any code paths that allow user input to influence inline event handlers or script contexts, and validate social profile fields as benign URLs or plain text.

Standardize on an output-encoding-by-default templating approach, adopt secure coding guidelines for handling user input, integrate static and dynamic security testing into the development pipeline, and enforce defense-in-depth controls such as CSP and reduced reliance on inline JavaScript.

Find out what's already
exploitable in your codebase.