CVE-2025-62521·PHP vulnerability
ChurchCRM is an open-source church management system. Prior to version 5.21.0, a pre-authentication remote code execution vulnerability in ChurchCRM's setup wizard allows unauthenticated attackers to inject arbitrary PHP code during the initial installation process, leading to complete server compromise. The vulnerability exists in `setup/routes/setup.php` where user input from the setup form is directly concatenated into a PHP configuration template without any validation or sanitization. Any parameter in the setup form can be used to inject PHP code that gets written to `Include/Config.php`, which is then executed on every page load. This is more severe than typical authenticated RCE vulnerabilities because it requires no credentials and affects the installation process that administrators must complete. Version 5.21.0 patches the issue.
- Severity
- critical
- Software
- PHP
- Fixed in
- 5.21.0
- Published
- 2025-12-17
Affected versions
Until: 5.21.0
Fixed in: 5.21.0
How to fix this CVE
Upgrade ChurchCRM to version 5.21.0 or later immediately, as this critical vulnerability allows unauthenticated attackers to execute arbitrary PHP code during the setup wizard. If your installation is still in the setup phase, complete the installation with version 5.21.0 or later to prevent compromise. If you are running a vulnerable version in production, audit your Include/Config.php file for suspicious PHP code and review setup logs for evidence of exploitation before updating.
sudo dnf update phpDefensia detects this vulnerability
What an exploitation attempt looks like
Sample log line indicative of exploitation attempts:
POST /setup/routes/setup.php with form parameters containing PHP control characters (<?php, eval(), system(), exec()) or suspicious variable assignments in HTTP request bodies; also look for HTTP 200 responses from /setup/ endpoint followed by writes to Include/Config.php containing unexplained PHP functionsWAF mitigation (if patching is not yet possible)
Add this rule to your WAF to block exploitation attempts while you schedule the patch.
Block all HTTP requests to /setup/ path if the installation is complete; implement input validation rules that reject form submissions containing PHP tags (<?php, ?>, eval, system, exec) to the setup endpoint; rate-limit POST requests to setup routes to slow reconnaissance attemptsHow to check if you are affected
- Check your ChurchCRM version: grep -i 'version' path/to/churchcrm/version.txt or check the admin panel under Settings → System Information
- Verify if the setup wizard is still accessible: curl -s http://your-domain/setup/ | grep -i 'setup\|install' to confirm if setup.php is reachable
- Examine Include/Config.php for suspicious PHP code: cat Include/Config.php | grep -E '(eval|system|exec|passthru|shell_exec|proc_open)' to detect injected code
- Confirm the patch by verifying the ChurchCRM version is 5.21.0 or higher: grep -r 'VERSION' path/to/churchcrm/ or check the release tag in git
FAQ
What is CVE-2025-62521?
CVE-2025-62521 is a critical pre-authentication remote code execution vulnerability in ChurchCRM that allows attackers to inject malicious PHP code through the setup wizard without requiring login credentials. The injected code is written directly to the configuration file and executed on every page load, leading to complete server compromise.
Is CVE-2025-62521 being actively exploited?
No, there are currently no reports of active exploitation in the wild, and no public exploits are available. However, the ease of exploitation and critical severity mean you should patch immediately to prevent opportunistic attacks.
What versions of ChurchCRM are affected by CVE-2025-62521?
All versions of ChurchCRM prior to 5.21.0 are vulnerable. Version 5.21.0 and later contain the necessary input validation and sanitization fixes.
How do I check if my server is vulnerable to CVE-2025-62521?
Run: curl -s http://your-domain/setup/ | grep -i 'setup' to see if the setup wizard is accessible, and verify your ChurchCRM version is below 5.21.0. If the setup wizard is reachable and you're on a vulnerable version, your server is at immediate risk.
Does Defensia detect CVE-2025-62521?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If ChurchCRM or PHP is installed on a monitored server, CVE-2025-62521 will appear in your dashboard with remediation steps.
Related PHP CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2025-62521. Free for 1 server.
Get started free