CVE-2025-54058

8.8 HIGH

📋 TL;DR

This SQL injection vulnerability in WeGIA allows attackers to manipulate database queries through the idatendido_familiares parameter, potentially accessing sensitive information like user data and table structures. All organizations using WeGIA versions before 3.4.6 are affected, particularly charitable institutions that rely on this Portuguese-language web manager.

💻 Affected Systems

Products:
  • WeGIA
Versions: All versions prior to 3.4.6
Operating Systems: Any OS running WeGIA (typically Linux)
Default Config Vulnerable: ⚠️ Yes
Notes: Affects the /html/funcionario/dependente_editarEndereco.php endpoint specifically. The vulnerability is present in default installations.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including extraction of all sensitive data (personal information, credentials, financial records), potential data destruction, and possible server takeover through SQL injection chaining.

🟠

Likely Case

Unauthorized access to sensitive database information including personal data of beneficiaries, employees, and organizational records, potentially leading to data breaches and privacy violations.

🟢

If Mitigated

Limited information disclosure if proper input validation and WAF rules are in place, but SQL injection attempts may still be logged.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW

SQL injection vulnerabilities are typically easy to exploit with standard tools like sqlmap. The advisory suggests authentication may be required, but this should be verified.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 3.4.6

Vendor Advisory: https://github.com/LabRedesCefetRJ/WeGIA/security/advisories/GHSA-5pwp-39jc-wxj8

Restart Required: Yes

Instructions:

1. Backup your current WeGIA installation and database. 2. Download WeGIA version 3.4.6 from the official repository. 3. Replace the vulnerable file /html/funcionario/dependente_editarEndereco.php with the patched version. 4. Restart your web server (Apache/Nginx). 5. Verify the fix by testing the endpoint with SQL injection payloads.

🔧 Temporary Workarounds

WAF Rule Implementation

all

Implement web application firewall rules to block SQL injection patterns in the idatendido_familiares parameter

# Example ModSecurity rule: SecRule ARGS:idatendido_familiares "@detectSQLi" "id:1001,phase:2,deny,status:403,msg:'SQLi attempt detected'"

Input Validation Filter

all

Add input validation to sanitize the idatendido_familiares parameter before processing

# PHP example: $id = filter_var($_POST['idatendido_familiares'], FILTER_VALIDATE_INT); if($id === false) { die('Invalid input'); }

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate the WeGIA application from other critical systems
  • Deploy a web application firewall with SQL injection detection rules specifically for the vulnerable endpoint

🔍 How to Verify

Check if Vulnerable:

Test the /html/funcionario/dependente_editarEndereco.php endpoint with SQL injection payloads in the idatendido_familiares parameter (e.g., ' OR '1'='1). Monitor for database errors or unexpected responses.

Check Version:

Check the WeGIA version in the application interface or review the source code for version markers. For command line: grep -r "version" /path/to/wegia/ | grep -i "3\."

Verify Fix Applied:

After patching, attempt the same SQL injection tests. The application should reject malformed input or return appropriate error messages without database errors.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL syntax in POST parameters to /html/funcionario/dependente_editarEndereco.php
  • Database error messages containing SQL fragments in web server logs
  • Multiple failed authentication attempts followed by SQL injection patterns

Network Indicators:

  • Unusual database query patterns from web server to database
  • High volume of requests to the vulnerable endpoint with parameter manipulation

SIEM Query:

source="web_server_logs" AND uri="/html/funcionario/dependente_editarEndereco.php" AND (param="*idatendido_familiares*" AND (value="*OR*" OR value="*UNION*" OR value="*SELECT*" OR value="*--*" OR value="*'*"))

🔗 References

📤 Share & Export