CVE-2025-50201

9.8 CRITICAL

📋 TL;DR

CVE-2025-50201 is an unauthenticated OS command injection vulnerability in WeGIA web management software that allows attackers to execute arbitrary commands on the server with web server user privileges. This affects all WeGIA installations prior to version 3.4.2. Attackers can exploit this remotely without any authentication.

💻 Affected Systems

Products:
  • WeGIA
Versions: All versions prior to 3.4.2
Operating Systems: Linux, Unix-based systems
Default Config Vulnerable: ⚠️ Yes
Notes: All default installations are vulnerable. The vulnerable endpoint /html/configuracao/debug_info.php is accessible without authentication.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete server compromise leading to data theft, ransomware deployment, lateral movement to other systems, and persistent backdoor installation.

🟠

Likely Case

Server takeover, credential harvesting, installation of cryptocurrency miners or botnet malware, and data exfiltration.

🟢

If Mitigated

Limited impact due to web server user privilege restrictions, but still allows file system access, configuration viewing, and potential privilege escalation.

🌐 Internet-Facing: HIGH
🏢 Internal Only: HIGH

🎯 Exploit Status

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

The vulnerability is straightforward to exploit with simple command injection techniques. No authentication required makes it highly attractive to attackers.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 3.4.2

Vendor Advisory: https://github.com/LabRedesCefetRJ/WeGIA/security/advisories/GHSA-52p5-5fmw-9hrf

Restart Required: No

Instructions:

1. Backup your current WeGIA installation and database. 2. Download WeGIA version 3.4.2 from the official repository. 3. Replace the vulnerable files with the patched version. 4. Verify the patch by checking that the branch parameter is now properly sanitized in /html/configuracao/debug_info.php.

🔧 Temporary Workarounds

Block Vulnerable Endpoint

linux

Use web server configuration to block access to the vulnerable debug_info.php endpoint

# For Apache: add to .htaccess or virtual host config
<Location "/html/configuracao/debug_info.php">
    Order deny,allow
    Deny from all
</Location>
# For Nginx: add to server block
location = /html/configuracao/debug_info.php {
    deny all;
    return 403;
}

Input Validation WAF Rule

all

Implement web application firewall rules to detect and block command injection attempts

# Example ModSecurity rule
SecRule ARGS:branch "@rx [;&|`$(){}]" \
    "id:1001,phase:2,deny,status:403,msg:'Command Injection Attempt'"
# Example naxsi rule
MainRule "str:;&|`$(){}<>" "msg:command injection" "mz:ARGS|BODY|URL|HEADERS" "s:$UWA:8" id:1001;

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate WeGIA servers from sensitive systems
  • Deploy application-level monitoring and alerting for suspicious command execution patterns

🔍 How to Verify

Check if Vulnerable:

Check if /html/configuracao/debug_info.php exists and responds without authentication. Test with safe command injection payload like 'branch=test;echo vulnerable' (use caution).

Check Version:

Check WeGIA version in configuration files or admin interface. Common location: /html/config/config.php or similar configuration files.

Verify Fix Applied:

Verify the patch by examining the debug_info.php file for proper input sanitization and attempting safe command injection tests that should now fail.

📡 Detection & Monitoring

Log Indicators:

  • Unusual command execution in web server logs
  • Multiple requests to debug_info.php with shell metacharacters
  • Web server process spawning unexpected child processes

Network Indicators:

  • HTTP requests to /html/configuracao/debug_info.php containing shell metacharacters
  • Outbound connections from web server to suspicious IPs

SIEM Query:

source="web_server_logs" AND uri="/html/configuracao/debug_info.php" AND (request_body CONTAINS ";" OR request_body CONTAINS "|" OR request_body CONTAINS "`" OR request_body CONTAINS "$" OR request_body CONTAINS "(")

🔗 References

📤 Share & Export