/

CVE-2026-35534

Severity:

HIGH RISK

(7.6)

XSS in ChurchCRM PersonView Facebook Field

CVE-2026-35534

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79, CWE-87, CWE-116

Impact:

Stored Cross-Site Scripting leading to session hijacking and account takeover

Severity:

HIGH RISK

(7.6)

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 contains a stored cross-site scripting vulnerability where user-controlled data from the Facebook field is written into an HTML attribute without proper escaping.

Authenticated users with the EditRecords role can inject JavaScript that executes whenever a victim views the affected profile page, potentially leading to session hijacking and full account takeover.

Affected context

The vulnerability occurs in the PersonView.php profile page when rendering a person's Facebook field into an HTML attribute (e.g., an href attribute).

The application relies on sanitizeText() as an output sanitizer even though it is only designed to strip HTML tags, not to escape characters required for safe use inside attributes.

Whenever a profile is viewed, any malicious payload stored in this field is reflected into the page, making users who browse profiles—especially administrators—potential targets.

Exploit preconditions

  • Attack surface: Web interface of ChurchCRM, specifically profile pages rendered by PersonView.php.
  • Required access: Any authenticated account with the EditRecords role that can modify a person's Facebook field.
  • Trigger point: A victim (including administrators) navigates to or views the profile page of a person whose Facebook field contains the malicious payload.
  • Why exploitation is possible: The Facebook field content is inserted into an HTML attribute using a sanitizer that only removes tags but does not escape quotes or other special characters. This allows an attacker to break out of the attribute context and attach arbitrary JavaScript event handlers.

Why this happens

This issue stems from using an input-focused or tag-stripping function (sanitizeText()) as if it were an output context-aware encoder.

In the affected code path, user data is written into an HTML attribute value without escaping quotes and other characters that are significant in that context, enabling the attacker to terminate the attribute and inject new attributes or inline event handlers.

Conceptually, this maps to:

  • CWE-79: Improper Neutralization of Input During Web Page Generation, because untrusted input is incorporated into a page without correct encoding.
  • It also relates to CWE-116: Improper Output Neutralization for Web Page Generation and CWE-87: Improper Neutralization of Alternate XSS Syntax, since the issue arises specifically from failing to encode attribute delimiters and alternative script injection forms.

Potential impact

  • Theft of active user session cookies, enabling session hijacking.
  • Full account takeover of administrative or privileged users who view a malicious profile.
  • Execution of arbitrary JavaScript in the context of the ChurchCRM application.
  • Unauthorized actions performed on behalf of victims (e.g., data modification, configuration changes).
  • Pivoting to broader compromise of church data and sensitive member information.

General mitigation guidance

Effective mitigation focuses on context-aware output encoding and strict handling of untrusted data:

  • Apply HTML attribute-specific encoding when inserting untrusted data into attributes (e.g., escaping quotes and other special characters).
  • Use well-vetted templating or encoding libraries that automatically select the correct encoder for the target context (HTML body, attribute, URL, JavaScript).
  • Treat user-supplied profile fields, including URLs such as Facebook links, as untrusted and subject to both validation and output encoding.
  • Prefer storing raw user input and performing encoding only at the last moment before output, using the correct encoder for that context.
  • Limit the capabilities of low-privileged roles by applying least-privilege access controls, so fewer accounts can store potentially malicious content.

How teams detect issues like this

Detection can be approached through both manual and automated techniques:

  • Static analysis: Configure rules to flag concatenation of user-controlled variables into HTML attributes without proper context-aware encoding; look specifically for uses of generic sanitizers (like tag-stripping functions) at output sinks.
  • Code review: During reviews, trace the flow of user input fields (e.g., profile and social media fields) to their render locations, ensuring that the encoder matches the output context (HTML vs attribute vs JS).
  • Automated scanning: Use dynamic application security testing (DAST) tools or browser-based scanners configured to probe stored fields with XSS payloads and monitor for script execution on profile pages.
  • Security linters/pipelines: Integrate security-focused linting or SAST tools into CI pipelines to enforce policies around safe output encoding and prohibit use of generic sanitization where context-aware encoding is required.

Sources

SourceLink
github.comgithub.com/ChurchCRM/CRM/security/advisories/GHSA-pqp6-54p2-m66f

Frequently asked

questions

Exploitation is limited to authenticated users with the EditRecords role who can modify a person's Facebook field, but any user—including administrators—who views that profile can be impacted once a payload is stored.

No. The attacker only needs an account with the EditRecords role or equivalent permission to edit profile fields; administrative privileges are not required to plant the payload, though compromising an administrator is a likely goal.

Ensure that all untrusted values placed in HTML attributes are encoded using an attribute-safe encoder, and avoid using tag-stripping or generic sanitization functions as output encoders. Centralizing output encoding in well-tested helpers or a templating engine reduces the chance of misuse.

Adopt a consistent encoding strategy where encoding is context-specific (HTML, attribute, JS, URL), enforce this via secure coding guidelines and code review checklists, and use automated tools to flag direct insertion of user data into templates without appropriate encoding.

Find out what's already
exploitable in your codebase.