Summary
A reflected cross-site scripting (XSS) flaw in the ChurchCRM login page allows untrusted data from the username URL parameter to be rendered without sanitization or encoding.
An attacker who can trick users into following a crafted login URL may execute JavaScript in the victim's browser, potentially stealing session cookies or presenting a fake login form.
Affected context
The vulnerability occurs on the ChurchCRM login page where the username parameter from the URL is echoed into an input element without output encoding.
It becomes relevant in contexts where users are likely to click or be redirected via links to the application's login page, such as email notifications, shared links, or redirects from other systems.
The issue manifests specifically when user-controlled data is rendered in HTML attributes without proper escaping in a browser-executed context.
Exploit preconditions
- Attack surface: Public or internal ChurchCRM login endpoint accessible via a web browser.
- Required access: Ability to craft and distribute a specially formed URL containing a malicious
usernameparameter (no authentication required). - Trigger point: A victim opens the crafted URL and the login page reflects the
usernamevalue into the input field, causing the browser to interpret the injected payload as script. - Why exploitation is possible: The application directly interpolates untrusted data into an HTML attribute without proper escaping or context-aware encoding, allowing script-breaking characters to alter the DOM and inject executable JavaScript.
Why this happens
This vulnerability stems from improper neutralization of input before it is included in a web page, aligning with CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-site Scripting).
The ChurchCRM login template takes the username parameter from the URL query string and outputs it into the value of an input element without applying HTML attribute encoding or validating allowable characters.
Because the browser interprets the resulting markup, attackers can inject characters that terminate the intended attribute and introduce arbitrary script, demonstrating a classic reflected XSS pattern where the response directly mirrors attacker-controlled input.
Potential impact
- Attackers can execute arbitrary JavaScript in the victim's browser within the ChurchCRM origin.
- Session cookies or other authentication tokens stored for the ChurchCRM domain may be accessed and exfiltrated.
- Sensitive data displayed or accessible within the authenticated ChurchCRM interface can be read via follow-on actions if the victim is already logged in.
- The login page's content can be modified to display a fake login form, enabling credential harvesting and phishing.
- Users may be redirected to attacker-controlled sites from within the compromised page.
General mitigation guidance
Effective mitigation focuses on strict output encoding and minimizing trust in URL parameters:
- Apply context-aware output encoding for any user-controlled data rendered in HTML, specifically HTML attribute encoding for values placed inside
value=""attributes. - Treat URL parameters, including
username, as untrusted input and validate them against a strict allowlist (e.g., expected username character sets and length). - Use templating frameworks or helper methods that default to safe escaping and discourage manual concatenation of user input into HTML.
- Avoid reflecting raw query parameters directly; instead, store required values server-side or in short-lived, validated tokens.
- Enforce security headers such as Content Security Policy (CSP) to reduce the impact of any remaining injection vectors where feasible.
How teams detect issues like this
Organizations can identify similar XSS issues through:
- Static analysis rules that flag direct inclusion of request parameters in HTML templates without encoding or use of unsafe rendering APIs.
- Manual code review focused on authentication and login views, checking for any reflected query parameters in HTML, JavaScript, or attributes.
- Automated dynamic application security testing (DAST) or fuzzing that injects common XSS payload markers into query parameters and observes reflected responses.
- Logging and monitoring for anomalous query strings containing script-like patterns or suspicious characters in parameters such as
username.

