critical CVSS 9.9

CVE-2025-58159·PHP vulnerability

WeGIA is a Web manager for charitable institutions. Prior to version 3.4.11, a remote code execution vulnerability was identified, caused by improper validation of uploaded files. The application allows an attacker to upload files with arbitrary filenames, including those with a .php extension. Because the uploaded file is written directly to disk without adequate sanitization or extension restrictions, a spreadsheet file followed by PHP code can be uploaded and executed on the server, leading to arbitrary code execution. This is due to insufficient mitigation of CVE-2025-22133. This issue has been patched in version 3.4.11.

Severity
critical
Software
PHP
Fixed in
3.4.11
Published
2025-08-29

Affected versions

Until: 3.4.11

Fixed in: 3.4.11

How to fix this CVE

Upgrade WeGIA to version 3.4.11 or later to patch the file upload validation bypass that allows arbitrary PHP file execution. This update implements proper file extension restrictions and sanitization to prevent attackers from uploading executable files disguised as spreadsheets. Organizations running earlier versions should prioritize this update to eliminate remote code execution risks on their web servers.

sudo dnf update php

Defensia detects this vulnerability

What an exploitation attempt looks like

Sample log line indicative of exploitation attempts:

POST requests to upload endpoints with Content-Disposition headers containing filenames ending in .php, .phtml, or .phar; or multipart form data with executable extensions disguised within archive or spreadsheet MIME types (application/vnd.ms-excel, application/zip) but with PHP extensions in the actual filename

WAF mitigation (if patching is not yet possible)

Add this rule to your WAF to block exploitation attempts while you schedule the patch.

Block HTTP POST/PUT requests to file upload endpoints where the filename parameter contains double extensions (e.g., .xls.php, .csv.php) or executable extensions (.php, .phtml, .php3, .php4, .php5, .phar). Implement Content-Type validation to reject uploads that claim to be spreadsheets but contain PHP code patterns.

How to check if you are affected

  1. Check installed PHP version: php -v
  2. Verify WeGIA installation location: find / -name 'WeGIA*' -type d 2>/dev/null | head -5
  3. Search web server logs for suspicious file uploads: grep -i 'upload' /var/log/apache2/access.log | grep -E '\.(php|phtml|php3|php4|php5|phar)'
  4. Confirm patch applied by checking WeGIA version in installation directory or admin panel, then verify PHP version matches or exceeds the patched release

FAQ

What is CVE-2025-58159?

CVE-2025-58159 is a critical remote code execution vulnerability in WeGIA (a web management system for charitable institutions) that allows authenticated attackers to bypass file upload validation and execute arbitrary PHP code by uploading files with .php extensions.

Is CVE-2025-58159 being actively exploited?

No, this vulnerability is not listed as actively exploited by CISA, and no public exploits are currently available, though organizations should still patch immediately given the critical severity and ease of exploitation.

What versions of WeGIA are affected by CVE-2025-58159?

All versions of WeGIA prior to 3.4.11 are vulnerable. Version 3.4.11 and later contain the remediation.

How do I check if my server is vulnerable to CVE-2025-58159?

Identify the WeGIA installation with find / -name 'WeGIA*' -type d, then check the version number in the installation directory or admin panel. If the version is below 3.4.11, your system is vulnerable.

Does Defensia detect CVE-2025-58159?

Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If WeGIA is installed on a monitored server, CVE-2025-58159 will appear in your dashboard with remediation steps.

Related PHP CVEs

CVE-2024-5932CVSS 10The GiveWP – Donation Plugin and Fundraising Platform plugin for WordPress is vulnerable to PHP Object Injection in all versions up to, and including, 3.14.1 via deserialization of untrusted input from the 'give_title' parameter. This makes it possible for unauthenticated attackers to inject a PHP Object. The additional presence of a POP chain allows attackers to execute code remotely, and to delete arbitrary files.
CVE-2025-47916CVSS 10Invision Community 5.0.0 before 5.0.7 allows remote code execution via crafted template strings to themeeditor.php. The issue lies within the themeeditor controller (file: /applications/core/modules/front/system/themeeditor.php), where a protected method named customCss can be invoked by unauthenticated users. This method passes the value of the content parameter to the Theme::makeProcessFunction() method; hence it is evaluated by the template engine. Accordingly, this can be exploited by unauthenticated attackers to inject and execute arbitrary PHP code by providing crafted template strings.
CVE-2025-25174CVSS 10Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion') vulnerability in beeteam368 BeeTeam368 Extensions beeteam368-extensions allows PHP Local File Inclusion.This issue affects BeeTeam368 Extensions: from n/a through <= 1.9.4.
CVE-2026-39337CVSS 10ChurchCRM is an open-source church management system. Prior to 7.1.0, critical 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 "$dbPassword" variable is not sanitized. This vulnerability exists due to an incomplete fix for CVE-2025-62521. This vulnerability is fixed in 7.1.0.
CVE-2026-28289CVSS 10FreeScout is a free help desk and shared inbox built with PHP's Laravel framework. A patch bypass vulnerability for CVE-2026-27636 in FreeScout 1.8.206 and earlier allows any authenticated user with file upload permissions to achieve Remote Code Execution (RCE) on the server by uploading a malicious .htaccess file using a zero-width space character prefix to bypass the security check. The vulnerability exists in the sanitizeUploadedFileName() function in app/Http/Helper.php. The function contains a Time-of-Check to Time-of-Use (TOCTOU) flaw where the dot-prefix check occurs before sanitization removes invisible characters. This vulnerability is fixed in 1.8.207.

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-58159. Free for 1 server.

Get started free