Summary
ChurchCRM allows authenticated administrators to upload plugin ZIP archives that may contain executable PHP files placed directly under the web root.
Because standard .php files are explicitly permitted and immediately accessible over HTTP, an attacker with admin-level access can achieve remote code execution by uploading a malicious plugin archive from a controlled URL.
Affected context
This vulnerability occurs in ChurchCRM's plugin installation mechanism when ZIP archives are fetched and extracted into a directory served by the web server.
The risk is present when:
- The plugin installer accepts archives from arbitrary HTTPS URLs
- The system allows
.phpfiles as valid plugin contents - Extracted plugin files are placed directly under a web-accessible path
Under these conditions, any PHP contained in a plugin ZIP can be executed via a browser request.
Exploit preconditions
- Attack surface: ChurchCRM web interface, specifically
/plugins/install-url(management.php) - Required access: Authenticated administrator account capable of installing plugins
- Trigger point: Uploading or sourcing a crafted plugin ZIP containing a PHP webshell or arbitrary PHP script
- Why exploitation is possible: The plugin installation pipeline permits
.phpinALLOWED_EXTENSIONS, does not effectively deny standard PHP files, and extracts them directly into the web root, making them immediately reachable via HTTP without further activation.
Why this happens
The underlying bug is an insecure file type handling pattern within the plugin upload and extraction workflow.
By treating .php as an allowed extension while relying on a denylist that does not block typical PHP filenames, the system accepts server-side executable files as benign plugin content.
This maps to CWE-434: Unrestricted Upload of File with Dangerous Type, where user-controlled uploads (or remote archives) are insufficiently constrained, allowing direct placement of executable files into a web-accessible directory.
The lack of separation between plugin storage and the HTTP-served web root further amplifies the risk by making newly uploaded PHP code callable via standard web requests.
Potential impact
- Remote execution of arbitrary PHP code on the ChurchCRM server
- Full compromise of the application and underlying operating system within web server privileges
- Access to or modification of sensitive congregation, financial, or personal data stored in ChurchCRM
- Deployment of persistent webshells enabling long-term unauthorized access
- Use of the compromised server as a pivot point for further internal network attacks
General mitigation guidance
Effective mitigation focuses on restricting executable file uploads and segregating plugin code from the public web root.
General defensive patterns include:
- Treating all uploaded or remotely fetched content as untrusted and validating file types using allowlists that exclude any server-executable formats (e.g.,
.php,.phtml,.phar). - Storing plugin archives and extracted files outside the web-accessible directory and routing execution through controlled loader mechanisms rather than direct HTTP access.
- Implementing robust server-side checks on plugin metadata and contents, including recursive inspection of archive structures to enforce safe file types.
- Applying least-privilege principles to the web server user so that even if a misconfiguration occurs, the impact of executed plugin code is constrained.
- Designing plugin systems so that newly added code must pass explicit review or verification steps before being loaded into the runtime environment.
How teams detect issues like this
Detection typically involves a combination of code-centric and operational controls:
- Static analysis or manual code review to identify upload paths that accept dangerous file types, especially where archives are extracted into web-accessible directories.
- Inspection of configuration constants such as
ALLOWED_EXTENSIONSandDENIED_EXTENSIONSfor inclusion of server-side executable extensions. - Logging and monitoring of plugin installation workflows, including origin URLs for remotely sourced ZIP archives and unexpected additions of
.phpfiles in plugin directories. - File integrity monitoring on web root and plugin directories to flag new or modified executable scripts.
- Security policies in CI/CD pipelines that block introduction of patterns where user-uploaded content can be executed directly by the web server.

