critical CVSS 9.9

CVE-2025-58745·PHP vulnerability

WeGIA is a Web manager for charitable institutions. The fix for CVE-2025-22133 was not enough to remediate the arbitrary file upload vulnerability. The WeGIA only check MIME types for Excel files at endpoint `/html/socio/sistema/controller/controla_xlsx.php`, which can be bypassed by using magic bytes of Excel file in a PHP file. As a result, attacker can upload webshell to the server for remote code execution. Version 3.4.11 contains an updated fix.

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

Affected versions

Until: 3.4.11

Fixed in: 3.4.11

How to fix this CVE

Upgrade PHP and the WeGIA application to version 3.4.11 or later to address a critical file upload vulnerability that allows attackers to bypass MIME type validation by injecting Excel magic bytes into PHP files. This vulnerability enables remote code execution on affected servers and must be patched immediately. After upgrading, verify that file upload endpoints properly validate file content rather than relying solely on MIME type headers.

sudo dnf update php php-common php-cli php-fpm

Defensia detects this vulnerability

What an exploitation attempt looks like

Sample log line indicative of exploitation attempts:

POST /html/socio/sistema/controller/controla_xlsx.php with file upload containing magic bytes PK\x03\x04 (ZIP/Excel signature) followed by PHP code; look for requests from authenticated users with suspicious filenames like *.php.xlsx or files with double extensions

WAF mitigation (if patching is not yet possible)

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

Implement content-based file validation rules that inspect file headers and magic bytes, not just MIME types; block uploads to /html/socio/sistema/controller/ endpoints that contain PHP executable code; enforce strict file type whitelisting for Excel imports and reject any multi-part uploads containing PHP MIME types

How to check if you are affected

  1. Run `php -v` to confirm the installed PHP version and check if it is below the patched version
  2. Verify the WeGIA application version by checking the version file or admin panel (typically found in /html/socio/sistema/ or documented in README/CHANGELOG)
  3. Search web server logs for POST requests to `/html/socio/sistema/controller/controla_xlsx.php` with suspicious file uploads: `grep -i 'controla_xlsx.php' /var/log/apache2/access.log | grep POST`
  4. Examine uploaded files in the WeGIA upload directory for PHP files with Excel magic bytes (PK\x03\x04 or similar): `find /var/www/wegia/uploads -type f -exec file {} \; | grep -i 'php\|executable'`

FAQ

What is CVE-2025-58745?

A critical vulnerability in WeGIA that allows authenticated users to upload PHP webshells by disguising them as Excel files using magic bytes, bypassing MIME type checks and leading to remote code execution.

Is CVE-2025-58745 being actively exploited?

No, CVE-2025-58745 is not currently listed in CISA's Known Exploited Vulnerabilities catalog and has no publicly available exploits, though the attack method is straightforward and organizations should patch immediately.

What versions of PHP are affected by CVE-2025-58745?

This vulnerability affects WeGIA versions up to and including 3.4.10; it is fixed in version 3.4.11. The vulnerability exists in the application layer rather than PHP itself, so any PHP version running vulnerable WeGIA versions is at risk.

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

Check the WeGIA version in your installation with `cat /path/to/wegia/version.txt` or via the admin panel; if it is below 3.4.11, your server is vulnerable. Additionally, verify that `/html/socio/sistema/controller/controla_xlsx.php` exists and is accessible.

Does Defensia detect CVE-2025-58745?

Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If PHP is installed on a monitored server, CVE-2025-58745 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-58745. Free for 1 server.

Get started free