CVE-2025-62360

8.8 HIGH

📋 TL;DR

A SQL injection vulnerability in WeGIA's /html/funcionario/dependente_documento.php endpoint allows attackers to execute arbitrary SQL commands via the id_dependente parameter. This can lead to data theft, data manipulation, or complete database compromise. All WeGIA installations prior to version 3.5.1 are affected.

💻 Affected Systems

Products:
  • WeGIA Web Manager
Versions: All versions prior to 3.5.1
Operating Systems: Any OS running WeGIA
Default Config Vulnerable: ⚠️ Yes
Notes: Affects all deployments using the vulnerable endpoint. Portuguese language focus but affects all installations.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including data exfiltration, data destruction, privilege escalation, and potential remote code execution if database functions allow it.

🟠

Likely Case

Unauthorized data access and manipulation of employee-dependent records, potentially leading to data theft or integrity issues.

🟢

If Mitigated

Limited impact with proper input validation, parameterized queries, and database user privilege restrictions in place.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

SQL injection is a well-understood attack vector with many automated tools available. Requires access to the vulnerable endpoint.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 3.5.1

Vendor Advisory: https://github.com/LabRedesCefetRJ/WeGIA/security/advisories/GHSA-m4j6-q5m4-x24g

Restart Required: No

Instructions:

1. Backup your current WeGIA installation and database. 2. Download WeGIA version 3.5.1 or later from the official repository. 3. Replace the vulnerable file /html/funcionario/dependente_documento.php with the patched version. 4. Verify the fix by testing the endpoint with SQL injection test payloads.

🔧 Temporary Workarounds

Input Validation Filter

all

Add server-side validation to only accept numeric values for the id_dependente parameter

Modify dependente_documento.php to include: if (!is_numeric($_GET['id_dependente'])) { die('Invalid input'); }

WAF Rule

all

Implement web application firewall rules to block SQL injection patterns

Add WAF rule: SecRule ARGS:id_dependente "@detectSQLi" "id:1001,phase:2,deny,status:403"

🧯 If You Can't Patch

  • Implement strict input validation and parameterized queries in the application code
  • Restrict database user permissions to minimum required privileges

🔍 How to Verify

Check if Vulnerable:

Test the endpoint with SQL injection payloads like: /html/funcionario/dependente_documento.php?id_dependente=1' OR '1'='1

Check Version:

Check WeGIA version in admin panel or review application files for version markers

Verify Fix Applied:

Attempt SQL injection tests against the patched endpoint and verify they are rejected or properly handled

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL error messages in application logs
  • Multiple failed parameter validation attempts
  • Suspicious parameter values containing SQL keywords

Network Indicators:

  • HTTP requests to /html/funcionario/dependente_documento.php with SQL injection patterns in parameters

SIEM Query:

source="*wegia*" AND (url="*/dependente_documento.php*" AND (param="*UNION*" OR param="*SELECT*" OR param="*OR '1'='1*"))

🔗 References

📤 Share & Export