/

CVE-2026-56287

Severity:

HIGH RISK

(8.1)

Boolean SQL Injection (CWE-89) in Fineract Client API

CVE-2026-56287

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Data Exfiltration and Arbitrary File Disclosure

Severity:

HIGH RISK

(8.1)

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

Apache Fineract's Client Search API suffers from a boolean-based SQL Injection in the orderBy and sortOrder parameters, which are concatenated into SQL without proper validation.

An authenticated user with client-view permissions can craft orderBy values to extract data via blind SQL injection and, on MySQL/MariaDB, read arbitrary files accessible to the database process.

Affected context

This vulnerability occurs in Apache Fineract deployments exposing the Client Search API endpoint (GET /api/v1/clients) where request parameters are incorporated directly into SQL query construction.

It becomes relevant when the application allows authenticated users to control sorting fields (orderBy) and directions (sortOrder) without strict server-side validation or parameterization.

The risk is higher in environments where the backing database is MySQL or MariaDB, and the database process has read access to sensitive files on the host system.

Exploit preconditions

  • Attack surface: HTTP interface of the Client Search API (GET /api/v1/clients)
  • Required access: Valid authenticated user account with permission to view clients
  • Trigger point: Supplying crafted values in the orderBy (and to a lesser extent sortOrder) query parameters
  • Why exploitation is possible: User-controlled parameters are concatenated into dynamic SQL without strict whitelisting or parameter binding, enabling boolean-based conditions and function calls such as LOAD_FILE() to be embedded in the query.

Why this happens

The underlying issue is the construction of SQL queries by concatenating untrusted input from HTTP request parameters directly into the ORDER BY clause.

Instead of using parameterized queries or a vetted whitelist of allowed columns and sort directions, the implementation trusts the orderBy and sortOrder values supplied by the client.

This pattern maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command (SQL Injection), where attacker-controlled syntax can alter the intended query structure, enabling data extraction and database function misuse.

Potential impact

  • Authenticated attackers may extract sensitive data from the application database via blind boolean-based SQL injection.
  • Attackers could disclose arbitrary files readable by the database process on MySQL/MariaDB using functions such as LOAD_FILE().
  • Application data integrity can be impacted if the injected SQL influences write operations or internal logic.
  • Exposure of configuration files, credentials, or keys stored on the database host could facilitate broader compromise of the environment.

General mitigation guidance

Effective mitigation focuses on eliminating direct string concatenation of user input into SQL and reducing the trust placed in client-supplied query parameters.

Common defensive patterns include:

  • Restricting orderBy and sortOrder to a strict whitelist of server-defined column names and sort directions, rejecting any unexpected values.
  • Using parameterized queries or query builder abstractions that separate SQL structure from user data and prevent syntax injection.
  • Implementing centralized validation for all dynamic query parameters (sorting, filtering, pagination) to enforce allowable patterns.
  • Minimizing database privileges and filesystem access for the database user so that even if injection occurs, file disclosure and other advanced abuses are limited.
  • Adopting secure-by-default API designs where clients cannot influence raw SQL fragments, but instead choose from predefined, safe query options.

How teams detect issues like this

Detection typically involves a combination of code-level review and runtime monitoring:

  • Static analysis rules that flag use of string concatenation when building SQL queries, especially around ORDER BY, WHERE, and LIMIT clauses.
  • Targeted code review focusing on controller and repository layers handling Client Search API parameters, looking for missing validation and whitelisting.
  • Database query logging and anomaly detection to identify unexpected query patterns, such as use of functions like LOAD_FILE() or complex boolean expressions in ORDER BY.
  • Incorporating security-focused unit and integration tests that attempt malicious orderBy values to verify that injection attempts are rejected.
  • Leveraging automated security testing tools (SAST/DAST) configured to probe API endpoints with crafted sorting parameters and flag potential SQL injection behavior.

Sources

SourceLink
github.comgithub.com/apache/fineract/pull/6020
lists.apache.orglists.apache.org/thread/l5klcj2v0dx63bssvb0gmw1nzzc47col
openwall.comopenwall.com/lists/oss-security/2026/07/15/2

Frequently asked

questions

It is exploitable remotely via the HTTP API, but the attacker must be an authenticated user with permission to view clients, rather than an unauthenticated outsider.

The attacker needs valid credentials and the ability to call the Client Search API, plus control over the orderBy and sortOrder parameters. Elevated database or OS privileges are not required to trigger the injection itself.

The safest approach is to remove direct string concatenation of user input into SQL, enforce a strict whitelist of sortable fields and sort directions, and rely on parameterized queries or safe query builders for all dynamic parts of the query.

Establish secure coding standards that prohibit building SQL from raw user input, add centralized validation for query parameters, integrate static analysis into CI pipelines to catch unsafe SQL patterns, and perform regular security-focused code reviews of API endpoints that construct queries dynamically.

Find out what's already
exploitable in your codebase.