CVE-2025-23220

9.8 CRITICAL

📋 TL;DR

CVE-2025-23220 is a critical SQL injection vulnerability in WeGIA's adicionar_raca.php endpoint that allows attackers to execute arbitrary SQL commands. This enables complete database dumping, exposing sensitive information like user credentials and organizational data. All WeGIA deployments using vulnerable versions are affected.

💻 Affected Systems

Products:
  • WeGIA
Versions: All versions before 3.2.10
Operating Systems: All platforms running WeGIA
Default Config Vulnerable: ⚠️ Yes
Notes: Affects all deployments with the vulnerable endpoint accessible, regardless of configuration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise leading to data theft, credential harvesting, potential authentication bypass, and full system takeover.

🟠

Likely Case

Unauthorized access to sensitive data including user information, organizational records, and potential privilege escalation.

🟢

If Mitigated

Limited impact with proper input validation, WAF rules, and database permissions restricting damage to specific tables.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

SQL injection in adicionar_raca.php endpoint requires no authentication and can be exploited with standard SQLi techniques.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 3.2.10

Vendor Advisory: https://github.com/LabRedesCefetRJ/WeGIA/security/advisories/GHSA-425j-h4cf-g52j

Restart Required: No

Instructions:

1. Backup your current WeGIA installation and database. 2. Download WeGIA version 3.2.10 from the official repository. 3. Replace the vulnerable adicionar_raca.php file with the patched version. 4. Verify the fix by checking the commit hash matches the security advisory.

🔧 Temporary Workarounds

WAF Rule Implementation

all

Deploy web application firewall rules to block SQL injection patterns targeting the adicionar_raca.php endpoint.

# Example ModSecurity rule: SecRule ARGS "@detectSQLi" "id:1001,phase:2,deny,status:403,msg:'SQL Injection Attempt'"
# Configure WAF to block requests containing SQL keywords when targeting vulnerable endpoint

Endpoint Restriction

linux

Restrict access to the vulnerable endpoint using authentication or IP whitelisting.

# Apache: <Location "/adicionar_raca.php"> Require ip 192.168.1.0/24 </Location>
# Nginx: location = /adicionar_raca.php { allow 192.168.1.0/24; deny all; }

🧯 If You Can't Patch

  • Implement strict input validation and parameterized queries for all user inputs in the application.
  • Deploy a web application firewall with SQL injection detection rules and monitor for exploitation attempts.

🔍 How to Verify

Check if Vulnerable:

Check if WeGIA version is below 3.2.10 and if adicionar_raca.php endpoint exists without proper input sanitization.

Check Version:

grep -r "version\|VERSION" /path/to/wegia/ | grep -i "3\.[0-9]\+"

Verify Fix Applied:

Verify the adicionar_raca.php file hash matches the patched version in commit 1739e1589948a207b8a82b9bfe078cb826d420de.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL error messages in application logs
  • Multiple requests to adicionar_raca.php with SQL keywords (UNION, SELECT, INSERT, etc.)
  • Database connection errors or unusual query patterns

Network Indicators:

  • HTTP POST/GET requests to /adicionar_raca.php containing SQL injection payloads
  • Unusual database traffic patterns from web server

SIEM Query:

source="web_logs" AND url="/adicionar_raca.php" AND (payload="UNION" OR payload="SELECT" OR payload="INSERT" OR payload="DELETE")

🔗 References

📤 Share & Export