/

CVE-2026-58409

Severity:

CRITICAL RISK

(9.1)

Unrestricted File Upload (CWE-434) in ChurchCRM Plugins

CVE-2026-58409

Deferred

Vulnerability type

Category:

Unrestricted File Upload

CWE:

CWE-434

Impact:

Remote Code Execution by malicious plugin uploads

Severity:

CRITICAL RISK

(9.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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 .php files 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 .php in ALLOWED_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_EXTENSIONS and DENIED_EXTENSIONS for 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 .php files 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.

Sources

SourceLink
github.comgithub.com/ChurchCRM/CRM/security/advisories/GHSA-37mf-vq43-5qp9

Frequently asked

questions

Exploitation is limited to environments where an attacker can obtain administrator access to ChurchCRM.

Within that scope, the ability to supply a malicious plugin ZIP effectively grants remote code execution on the server.

Yes, the attacker must be authenticated as an administrator or possess equivalent privileges that allow access to the /plugins/install-url functionality and plugin installation controls.

The safest fix pattern is to remove all server-executable extensions (such as .php) from allowed plugin file types and ensure that plugin contents are stored outside the public web root, executed only through controlled, vetted mechanisms.

Prevention hinges on designing upload and plugin systems with strict file-type allowlists, isolating dynamic code from user-controlled inputs, conducting regular security reviews of extension mechanisms, and enforcing policies that forbid direct execution of user-supplied files from web-accessible directories.

Find out what's already
exploitable in your codebase.