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-fpmDefensia 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 extensionsWAF 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 typesHow to check if you are affected
- Run `php -v` to confirm the installed PHP version and check if it is below the patched version
- Verify the WeGIA application version by checking the version file or admin panel (typically found in /html/socio/sistema/ or documented in README/CHANGELOG)
- 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`
- 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
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