CVE-2025-62177

8.8 HIGH

📋 TL;DR

A SQL injection vulnerability in WeGIA's /html/funcionario/dependente_listar.php endpoint allows attackers to execute arbitrary SQL commands via the id_funcionario 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
Versions: All versions prior to 3.5.1
Operating Systems: Any OS running WeGIA
Default Config Vulnerable: ⚠️ Yes
Notes: The vulnerability exists in the default installation and requires no special configuration to be exploitable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including data exfiltration, data destruction, privilege escalation to system-level access, and potential lateral movement to other systems.

🟠

Likely Case

Unauthorized access to sensitive employee and dependent data, potential data modification, and possible authentication bypass to gain administrative access.

🟢

If Mitigated

Limited impact with proper input validation and WAF rules in place, potentially blocking malicious payloads before reaching the application.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

SQL injection vulnerabilities are commonly exploited and tooling exists for automated exploitation. The advisory provides enough detail for attackers to craft working exploits.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 3.5.1

Vendor Advisory: https://github.com/LabRedesCefetRJ/WeGIA/security/advisories/GHSA-4wrg-g9cj-hjcx

Restart Required: Yes

Instructions:

1. Backup your current WeGIA installation and database. 2. Download WeGIA version 3.5.1 from the official repository. 3. Replace the vulnerable files with the patched version. 4. Restart the web server service. 5. Verify the fix by testing the endpoint with SQL injection payloads.

🔧 Temporary Workarounds

Web Application Firewall (WAF) Rules

all

Implement WAF rules to block SQL injection patterns targeting the id_funcionario parameter

Input Validation Filter

all

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

🧯 If You Can't Patch

  • Implement strict input validation to only accept numeric values for the id_funcionario parameter
  • Deploy a web application firewall with SQL injection detection rules

🔍 How to Verify

Check if Vulnerable:

Test the /html/funcionario/dependente_listar.php endpoint with SQL injection payloads in the id_funcionario parameter (e.g., id_funcionario=1' OR '1'='1)

Check Version:

Check the WeGIA version in the application interface or review the source code version markers

Verify Fix Applied:

After patching, test the same endpoint with SQL injection payloads and verify they are rejected or properly handled

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL error messages in application logs
  • Multiple failed parameter validation attempts
  • Requests with SQL keywords in id_funcionario parameter

Network Indicators:

  • HTTP requests containing SQL injection patterns in URL parameters
  • Unusual database query patterns from the application server

SIEM Query:

source="web_logs" AND (uri_path="/html/funcionario/dependente_listar.php") AND (param="id_funcionario") AND (value MATCHES "(?i)(union|select|insert|update|delete|drop|or|and|'|--|#|;)")

🔗 References

📤 Share & Export