/

CVE-2026-52476

Severity:

HIGH RISK

(7.5)

SQL Injection (CWE-89) in aiflowy DatacenterQuery

CVE-2026-52476

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Confidentiality breach and potential data exposure via SQL injection

Severity:

HIGH RISK

(7.5)

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

A SQL injection flaw in aiflowy up to version 2.1.2 allows crafted input sent to the getPageData method in DatacenterQuery.java to be incorporated directly into SQL queries.

Under vulnerable configurations, a remote attacker can abuse this to access or infer sensitive information from the backend database.

Affected context

The vulnerability arises in server-side components of aiflowy (versions 2.1.2 and below) where DatacenterQuery.java implements the getPageData method.

This method appears to construct database queries using request-supplied parameters without consistently using parameterized statements or adequate input handling.

Environments that expose this functionality over a network and tie it to a relational database backend are more likely to be affected, especially when default or permissive database permissions are used.

Exploit preconditions

  • Attack surface: Network-accessible API or web endpoint that triggers getPageData in DatacenterQuery.java.
  • Required access: Ability to send requests with crafted query parameters or payload fields consumed by getPageData.
  • Trigger point: Dynamic SQL construction in DatacenterQuery.java where untrusted input is concatenated or interpolated into query strings.
  • Why exploitation is possible: The code path does not reliably use prepared statements or proper query parameterization, allowing attacker-controlled input to alter the structure of the SQL query executed by the database.

Why this happens

This issue stems from constructing SQL queries using string concatenation or equivalent non-parameterized patterns with untrusted input.

When application logic in DatacenterQuery.java builds SQL in getPageData directly from request data, the database engine cannot distinguish between data and control tokens such as operators or keywords.

This matches CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where failure to enforce strict separation between query logic and data allows attackers to inject additional conditions or subqueries.

Potential impact

  • Unauthorized reading of sensitive records from database tables
  • Circumvention of application-level access controls by directly querying protected data
  • Enumeration of database schema, including table and column names
  • Use of error responses or timing differences to infer data via blind SQL injection
  • In some database configurations, potential modification or deletion of data if the injection point can reach write operations

General mitigation guidance

Effective mitigation focuses on eliminating ad hoc SQL construction and tightening data access boundaries.

Recommended patterns include:

  • Consistently using parameterized queries or prepared statements for all database operations, ensuring user input is never concatenated into SQL strings.
  • Applying strict server-side validation and normalization for query parameters, restricting them to expected formats, types, and whitelisted values.
  • Structuring data access through well-defined repository or DAO layers that centralize SQL execution and enforce safe patterns by default.
  • Reducing database privileges for the application account to the minimum required, limiting the damage if injection still occurs.
  • Avoiding dynamic query generation for filtering and pagination where feasible, or implementing it using safe query builder abstractions rather than manual string assembly.

How teams detect issues like this

Identifying this class of issue typically combines code-centric and runtime approaches:

  • Static analysis rules that flag string concatenation or format operations involving SQL keywords and untrusted variables in Java code (especially in DatacenterQuery or DAO classes).
  • Code review checklists that require verification of prepared statement usage for every query, and disallow inline SQL construction using request parameters.
  • Logging and monitoring of unusual or malformed database queries, such as those containing unexpected operators or comment sequences, as indicators of active probing.
  • Integration of automated security testing (e.g., DAST scanners) that send injection payloads to endpoints invoking getPageData and observe database error messages or behavioral anomalies.

Sources

SourceLink
github.comgithub.com/Y4y17/CVE/blob/main/AiFlowy/SQL%20Injection.md

Frequently asked

questions

Yes, it is remotely exploitable whenever the endpoint or API invoking getPageData is exposed over the network and accepts user-controlled parameters.

An attacker typically needs only the ability to send HTTP or API requests to the affected functionality; no direct database access is required. Authentication requirements depend on how the application exposes the getPageData method.

The safest pattern is to refactor all database interactions in DatacenterQuery and related code to use parameterized queries or prepared statements exclusively, removing any string-based SQL concatenation that includes user input.

Establish development standards that mandate query parameterization, employ input validation on all external data, and incorporate static analysis and security-focused code review practices to catch unsafe query construction early in the development lifecycle.

Find out what's already
exploitable in your codebase.