CVE-2025-58159

9.9 CRITICAL

📋 TL;DR

CVE-2025-58159 is a critical remote code execution vulnerability in WeGIA web management software for charitable institutions. It allows attackers to upload malicious PHP files that execute arbitrary code on the server. All organizations using WeGIA versions before 3.4.11 are affected.

💻 Affected Systems

Products:
  • WeGIA
Versions: All versions prior to 3.4.11
Operating Systems: Any OS running WeGIA
Default Config Vulnerable: ⚠️ Yes
Notes: This vulnerability affects the default configuration of WeGIA installations.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete server compromise leading to data theft, ransomware deployment, or use as a foothold for lateral movement within the network.

🟠

Likely Case

Webshell installation allowing persistent access, data exfiltration, or cryptocurrency mining.

🟢

If Mitigated

Limited impact if proper file upload restrictions and web application firewalls are in place.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

The vulnerability is similar to CVE-2025-22133 and exploitation requires only web access to the upload functionality.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 3.4.11

Vendor Advisory: https://github.com/LabRedesCefetRJ/WeGIA/security/advisories/GHSA-wj2c-237g-cgqp

Restart Required: No

Instructions:

1. Backup your WeGIA installation and database. 2. Download version 3.4.11 from the official repository. 3. Replace existing files with the patched version. 4. Verify the update by checking the version in the admin panel.

🔧 Temporary Workarounds

Restrict PHP file uploads via web server

all

Configure web server to block .php file uploads at the server level

# For Apache: Add to .htaccess
<FilesMatch "\.php$">
    Order Allow,Deny
    Deny from all
</FilesMatch>
# For Nginx: Add to server block
location ~ \.php$ {
    deny all;
}

Implement file upload directory restrictions

linux

Move upload directory outside web root and restrict execution permissions

# Move uploads directory outside web root
mv /var/www/html/uploads /var/uploads

# Set restrictive permissions
chmod 644 /var/uploads/*
chown www-data:www-data /var/uploads

🧯 If You Can't Patch

  • Implement a web application firewall (WAF) with file upload filtering rules
  • Disable file upload functionality entirely in WeGIA configuration

🔍 How to Verify

Check if Vulnerable:

Check if WeGIA version is below 3.4.11 in the admin panel or by examining version files

Check Version:

grep -r "version" /path/to/wegia/installation/ | grep -i "3\."

Verify Fix Applied:

Confirm version is 3.4.11 or higher and test file upload functionality with PHP files (should be rejected)

📡 Detection & Monitoring

Log Indicators:

  • Multiple failed .php file upload attempts
  • Successful .php file uploads to upload directory
  • Unusual POST requests to upload endpoints

Network Indicators:

  • HTTP POST requests with .php files to upload endpoints
  • Outbound connections from WeGIA server to unknown IPs

SIEM Query:

source="web_logs" AND (uri_path="/upload" OR uri_path="/file/upload") AND (file_extension=".php" OR content_type="application/x-php")

🔗 References

📤 Share & Export