Summary
ChurchCRM's setup wizard previously allowed pre-authentication code injection through the unsanitized DB_PASSWORD parameter.
If an attacker could reach the setup interface, they could supply crafted input that is embedded into server-side code or commands, leading to full remote code execution.
Affected context
The vulnerability occurs in ChurchCRM deployments where the setup wizard is exposed and processes database connection parameters provided by the user.
Specifically, the DB_PASSWORD value from the setup flow is used in a way that influences server-side code or shell execution without robust sanitization or escaping.
Installations that leave the setup interface reachable in production, or that allow untrusted users to access the installer, are at particular risk.
Exploit preconditions
- Attack surface: HTTP(S) endpoint for the ChurchCRM setup wizard.
- Required access: Network access to the setup interface; no prior authentication required.
- Trigger point: Submission of the setup form that includes a crafted
DB_PASSWORDvalue. - Why exploitation is possible: The application interpolates or concatenates the supplied
DB_PASSWORDinto executable code or commands without sufficient neutralization, allowing attacker-controlled input to be interpreted as code.
Why this happens
This issue is a classic code injection vulnerability aligning with CWE-94: Improper Control of Generation of Code ('Code Injection').
The setup wizard treats user-controlled configuration data (DB_PASSWORD) as data but later uses it in a context where it is processed as code or command syntax.
Because the value is not strictly validated, escaped, or isolated from the execution environment, specially crafted payloads can break out of the intended data context and inject arbitrary instructions.
The incomplete fix for the earlier vulnerability left at least one code path in which DB_PASSWORD still influenced executable logic without adequate safeguards.
Potential impact
- Attacker can execute arbitrary commands or code on the server.
- Full compromise of the ChurchCRM application and its data.
- Access to or modification of the underlying database contents.
- Installation of backdoors or pivoting further into the hosting environment.
- Long-term persistence and tampering with church member records and sensitive information.
General mitigation guidance
Effective mitigation centers on treating all configuration input as untrusted and ensuring it never directly influences executable contexts.
Recommended patterns include:
- Avoid generating or concatenating code or shell commands from user-supplied configuration values such as
DB_PASSWORD. - Use parameterized APIs or configuration libraries that separate data from execution and do not require string-based command construction.
- Apply strict validation and normalization to all setup inputs, enforcing strong character and length constraints appropriate for passwords and connection strings.
- Isolate installer logic from runtime operations, and disable or remove the setup wizard once installation is complete.
- Run the application and its setup process with least-privilege accounts to reduce the blast radius of any unexpected execution.
How teams detect issues like this
Detection typically combines code-level analysis with deployment reviews:
- Static analysis: Search for patterns where user-supplied configuration values (e.g.,
DB_PASSWORD) flow intoeval-like constructs, dynamic includes, template evaluation, or shell/command execution APIs. - Code review: Flag any setup or installer code that builds configuration files, scripts, or commands via string concatenation or interpolation that includes untrusted input.
- Security testing: Use dynamic application security testing (DAST) and fuzzing on the setup wizard to detect when user input alters control flow or execution behavior.
- Policy enforcement: Enforce internal guidelines banning dynamic code generation from request parameters and requiring input validation for all installer fields; automated review tools can help enforce these policies in CI.

