/

CVE-2026-23723

Severity:

HIGH RISK

(7.2)

SQL Injection in WeGIA Atendido_ocorrenciaControle Endpoint

CVE-2026-23723

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Database Compromise and Potential File Disclosure

Severity:

HIGH RISK

(7.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

An authenticated SQL injection vulnerability in WeGIA's Atendido_ocorrenciaControle endpoint allows crafted input in the id_memorando parameter to alter backend database queries.

Under these conditions, an attacker with valid credentials can exfiltrate the full database, access sensitive PII, and, in some misconfigured deployments, pivot into arbitrary file reads on the server.

Affected context

This vulnerability occurs in WeGIA deployments that expose the Atendido_ocorrenciaControle functionality to authenticated users and build SQL statements using the id_memorando parameter without proper query parameterization.

It is most relevant where application accounts have broad database privileges or where the database server can access the underlying filesystem.

The issue is present in versions prior to 3.6.2 and depends on how access control and database permissions are configured within a given installation.

Exploit preconditions

  • Attack surface: HTTP(S) interface of the WeGIA web application, specifically the Atendido_ocorrenciaControle endpoint.
  • Required access: Valid authenticated user account with permission to reach the affected endpoint.
  • Trigger point: Server-side processing of requests that include attacker-controlled values in the id_memorando parameter.
  • Why exploitation is possible: User-supplied data is inserted directly into SQL query strings or is otherwise not parameterized or validated, allowing injection, manipulation of query structure, and abuse of database capabilities.

Why this happens

The core issue is a classic SQL injection flaw where dynamic SQL is constructed by concatenating or interpolating the id_memorando parameter into queries without using parameterized statements or adequate input handling.

This maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where attacker-controlled input is treated as part of the SQL syntax rather than as data.

As a result, an authenticated attacker can influence WHERE clauses, union in additional result sets, call database-specific functions, or leverage database features that access the underlying filesystem in permissive configurations.

Potential impact

  • Full database content exfiltration, including tables containing personal or operational data
  • Exposure of sensitive personally identifiable information (PII) about beneficiaries, staff, or donors
  • Tampering with application data, such as inserting, updating, or deleting records
  • Abuse of database-level functionality that may allow arbitrary file reads on the host in misconfigured environments
  • Indirect impact on availability through destructive queries or resource-intensive operations

General mitigation guidance

Effective mitigation focuses on eliminating direct string-based SQL construction and tightening trust boundaries around user input:

  • Adopt parameterized queries or prepared statements for all database operations involving user-supplied data, including id_memorando.
  • Introduce strict server-side validation and type enforcement, especially for identifier and numeric parameters, ensuring only expected formats are accepted.
  • Restrict database privileges so the application account has only the minimal permissions needed, limiting access to sensitive tables and filesystem-related features.
  • Implement centralized input handling and query-building patterns to avoid ad-hoc SQL creation spread across the codebase.
  • Consider adding application-layer access controls and data minimization so that even if a query is abused, the scope of accessible data is reduced.

How teams detect issues like this

Organizations can detect this class of issue using a combination of code-centric and behavior-centric approaches:

  • Static analysis: Configure SAST rules to flag dynamic SQL construction that includes variables derived from HTTP parameters, particularly within the Atendido_ocorrenciaControle controller or related data access layers.
  • Code review: Look for string concatenation or interpolation in SQL statements, absence of prepared statements, and inconsistent use of query parameterization patterns.
  • Runtime monitoring: Use database activity monitoring or application logs to spot unusual query patterns, such as unexpected UNION SELECT, subqueries, or queries referencing system tables from user-facing workflows.
  • Security testing: Apply authenticated SQL injection tests (e.g., with web vulnerability scanners or custom test cases) against authenticated endpoints that accept id_memorando or similar identifiers.

Sources

SourceLink
github.comgithub.com/LabRedesCefetRJ/WeGIA/pull/1333
github.comgithub.com/LabRedesCefetRJ/WeGIA/releases/tag/3.6.2
github.comgithub.com/LabRedesCefetRJ/WeGIA/security/advisories/GHSA-xfmp-2hf9-gfjp

Frequently asked

questions

Yes, but it requires authentication. An attacker must be able to log into the WeGIA application and reach the Atendido_ocorrenciaControle endpoint over the network.

The attacker needs a valid user account with access to the functionality that sends requests containing the id_memorando parameter. Elevated roles are not strictly required if the vulnerable endpoint is reachable to standard users.

The most robust approach is to replace dynamic SQL string building with parameterized queries across the affected code paths, combined with strict validation of the id_memorando parameter and reduction of database privileges.

Establish a development standard that mandates prepared statements for all database access, centralize data access logic, enforce input validation on all external inputs, and integrate static analysis plus security-focused code review into the regular development and CI processes.

Find out what's already
exploitable in your codebase.