Summary
A stored Cross-Site Scripting (XSS) vulnerability in ChurchCRM's admin panel group-creation feature allows users with group-creation privileges to inject JavaScript that is later executed in an administrator's browser.
When an admin views the affected page, the malicious script can run with their privileges, enabling session cookie theft and possible full administrative account takeover.
Affected context
The vulnerability occurs in ChurchCRM deployments where the admin panel's group-creation feature is accessible to non-admin users or lower-privileged roles.
Any environment that allows such users to create or edit group data that is later rendered in the admin interface without proper output encoding is at risk.
It is particularly relevant in multi-user ChurchCRM instances where multiple staff or volunteers can manage groups and administrators routinely review or manage these groups through the web UI.
Exploit preconditions
- Attack surface: Web-based ChurchCRM admin interface.
- Required access: Authenticated user account with permission to create or edit groups (does not need to be an administrator).
- Trigger point: An administrator later visits the group management or detail page where the stored data is rendered in the browser.
- Why exploitation is possible: User-supplied group fields are stored server-side and re-displayed in the admin panel without sufficient HTML/JavaScript output encoding, allowing arbitrary script execution in the admin's session.
Why this happens
The underlying bug is a failure to correctly escape or encode user-controlled data before rendering it into HTML in the admin interface.
This matches CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-site Scripting), where stored content from lower-privileged users is inserted into the DOM as active HTML/JavaScript rather than as inert text.
Additionally, CWE-1004: Sensitive Cookie Without 'HttpOnly' Flag may increase the impact by allowing injected scripts to directly read session cookies, making account takeover easier once JavaScript execution is achieved.
Potential impact
- Theft of administrator session cookies, which may allow impersonation of admin users.
- Full administrative account takeover, including access to sensitive configuration and member data.
- Unauthorized modification or deletion of records within ChurchCRM under an admin's authority.
- Use of the compromised admin account as a pivot to introduce further malicious content or conduct phishing attacks against other users.
General mitigation guidance
Effective mitigation focuses on treating all user-supplied content as untrusted and rendering it safely in the browser:
- Apply context-appropriate output encoding (e.g., HTML entity encoding, attribute encoding) to all dynamic data rendered in templates, especially in admin views.
- Prefer server-side templating frameworks and helper functions that encode by default instead of manually building HTML strings.
- Restrict which fields can contain HTML; for most administrative text fields, store and render only plain text.
- Consider implementing a Content Security Policy (CSP) that disallows inline scripts and limits script sources, reducing the blast radius of possible XSS.
- Configure session cookies with the
HttpOnlyflag to make them inaccessible to client-side scripts and reduce the impact of any XSS that does occur.
How teams detect issues like this
Detection typically combines code-level analysis with behavioral monitoring:
- Use static analysis or linting rules to flag direct insertion of user input into HTML templates without escaping, especially in admin or privileged views.
- During code review, look for raw echoing/printing of database-backed fields into the UI, and verify that helper functions provide proper output encoding.
- Employ web application security testing (manual or automated) to inject benign script patterns into group fields and observe whether they execute when the admin page is loaded.
- Monitor logs and alerts for suspicious group names or descriptions that contain script-like patterns, and correlate with admin session anomalies.

