Summary
ChurchCRM's setup wizard contained a pre-authentication code injection flaw where the $dbPassword installation parameter was incorporated into PHP code without proper sanitization.
During initial installation, an unauthenticated attacker able to reach the setup interface could inject arbitrary PHP code via this parameter, potentially achieving full remote code execution and complete server compromise.
Affected context
This vulnerability affects ChurchCRM instances that are not yet fully installed and expose the setup wizard over a network-accessible interface.
It is most relevant in deployments where:
- The ChurchCRM setup process is accessible from the internet or untrusted networks
- The database configuration step is performed through a web form
- Installation files and setup scripts remain reachable until installation is complete and the admin secures the environment
Because the issue occurs during initial configuration, even freshly deployed servers are at risk if the setup wizard is exposed to attackers.
Exploit preconditions
- Attack surface: HTTP(S) endpoint serving the ChurchCRM setup wizard.
- Required access: No authentication required; the attacker only needs network access to the installation page.
- User interaction: The setup wizard must be reachable and not yet locked down; the attacker submits crafted values for the
$dbPasswordfield. - Trigger point: The database configuration step where the application processes and embeds
$dbPasswordinto PHP or configuration logic. - Why exploitation is possible: The
$dbPasswordvariable is incorporated into dynamically generated PHP code or configuration without adequate sanitization or encoding, enabling injection of attacker-controlled code that is later executed by the PHP interpreter.
Why this happens
The root cause is improper neutralization of user-controlled input before it is incorporated into executable PHP code.
Specifically, the $dbPassword parameter from the setup wizard is treated as data but is placed into a context that is interpreted as code—such as direct concatenation into PHP scripts or configuration statements that PHP executes.
This pattern maps to CWE-94: Improper Control of Generation of Code ('Code Injection'), where application logic dynamically builds code constructs using untrusted values.
Additionally, the vulnerability stems from an incomplete or partial remediation of a prior issue (CVE-2025-62521), indicating that the original fix did not systematically remove all code paths where $dbPassword could influence code generation without strict validation and encoding.
Potential impact
- Full remote execution of arbitrary PHP code on the server
- Complete compromise of the ChurchCRM application and its data
- Theft or modification of sensitive church member records and financial data
- Installation of webshells or backdoors for persistent server access
- Use of the compromised server as a pivot point into the broader network
- Tampering with application integrity, including adding rogue admin accounts or altering configuration
General mitigation guidance
Effective mitigation focuses on eliminating dynamic code generation paths that are influenced by untrusted input and tightening the security of the installation workflow.
Recommended patterns include:
- Avoid dynamic code construction: Do not build PHP code strings using runtime user input such as
$dbPassword. Instead, use static templates with clearly defined configuration files or environment variables. - Treat configuration as data only: Ensure that installation parameters are written to configuration files in formats that are not parsed as executable PHP, or if PHP is used, values must be strictly escaped and never interpreted as code.
- Strong input neutralization: Apply rigorous escaping/encoding for any configuration values that might be embedded in language constructs, including quotes, delimiters, and special characters.
- Lock down the setup surface: Restrict access to the setup wizard to trusted administrators and internal networks only. Disable or remove setup components automatically once installation completes.
- Least privilege environment: Run the web server and PHP with minimal privileges, limiting the damage of potential compromise and restricting write access to sensitive directories.
- Holistic fix strategy: When addressing a previously reported issue, review all related code paths for similar patterns rather than patching only the initially reported instance.
How teams detect issues like this
Detection can combine code-centric and operational approaches:
- Static analysis: Configure static analyzers to flag:
- Dynamic
eval,assert,create_function, orinclude/requirestatements built from request parameters. - String concatenation where user-supplied data flows into PHP code fragments or configuration-generating functions.
- Any use of installation parameters (e.g.,
$dbPassword,$dbUser) in code-generating contexts. - Code review signals:
- Setup or installation scripts that write
.phpfiles containing interpolated user data. - Direct embedding of configuration values into executable PHP rather than purely data-oriented formats (e.g.,
.ini,.env, JSON). - "Quick fix" patches that sanitize input in only one location instead of analyzing the full data flow.
- Runtime monitoring:
- Web server logs showing unexpected or malformed values in installation parameters.
- File integrity monitoring on application directories to detect new or modified PHP files after installation.
- Automated checks in CI/CD:
- Security-focused linters and SAST tools integrated into pipelines, with policies specifically examining installation and configuration routines for code injection patterns.

