/

CVE-2026-40524

Severity:

HIGH RISK

(8.1)

SQL Injection (CWE-89) in FrontAccounting GL Reports

CVE-2026-40524

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Sensitive Data Exposure and Database Compromise

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

A SQL injection flaw in FrontAccounting's get_gl_transactions() function allows crafted filter_type values to be concatenated directly into an SQL IN() clause without parameterization.

With SA_GLANALYTIC privileges, an attacker can perform boolean-based blind SQL injection to exfiltrate sensitive general ledger and journal entry data via response size differences.

Affected context

This vulnerability arises within FrontAccounting deployments where users have access to general ledger analytic reporting features.

It specifically affects code paths that call get_gl_transactions() and pass the filter_type parameter directly into dynamically constructed SQL used for IN() filters.

The issue manifests when user-controlled filter values are not sanitized or parameterized, and application logic relies on the resulting query to retrieve journal entries and related ledger data.

Exploit preconditions

  • Attack surface: Web-based report and analytics interfaces that expose GL filter functionality.
  • Required access: Valid authenticated account with SA_GLANALYTIC permission, or equivalent role capable of invoking get_gl_transactions().
  • Trigger point: Submission of a crafted filter_type value that closes the existing IN() list and appends attacker-controlled SQL conditions.
  • Why exploitation is possible: The application concatenates filter_type directly into the SQL string without parameterization or proper validation, enabling injection into the query's WHERE clause and supporting boolean-based blind extraction via response size differences.

Why this happens

The core issue is the construction of SQL queries by directly interpolating user-controlled input into an IN() clause, instead of using bound parameters or a safe query builder.

This pattern maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where special characters like parentheses and logical operators are not neutralized, allowing the attacker to alter query semantics.

By allowing filter_type to terminate the intended list and introduce arbitrary predicates, the code effectively grants the user control over part of the WHERE clause, making the database logic dependent on untrusted input.

Potential impact

  • Attackers may extract sensitive journal entry and general ledger data that would otherwise require higher privileges.
  • SQL injection could be used to enumerate account structures, financial periods, and transaction metadata.
  • Depending on surrounding query logic and permissions, attackers could potentially pivot to broader data exposure across other tables.
  • In some configurations, injection might lead to data integrity issues, such as manipulating reporting outcomes or indirectly influencing financial analysis.

General mitigation guidance

Defensive strategies should focus on removing direct string concatenation in SQL and enforcing strict separation between data and query logic.

Recommended patterns include:

  • Using parameterized queries or prepared statements for all dynamic conditions, including IN() lists and filter parameters.
  • Normalizing filter inputs to known-safe identifiers (e.g., whitelisting acceptable filter_type values) rather than trusting raw user input.
  • Employing an application-level query builder or ORM that enforces parameterization by default and restricts ad-hoc SQL construction.
  • Applying least-privilege principles to reporting roles so that compromise of an analytic account cannot trivially lead to broad data access.

How teams detect issues like this

Effective detection typically combines code-level analysis with runtime monitoring:

  • Static analysis rules can flag direct concatenation of user-controlled input into SQL strings, especially inside IN() clauses and WHERE conditions.
  • Code reviews should scrutinize any custom report or analytics functions that construct dynamic SQL, looking for missing parameter binding and input validation.
  • Security linters or automated code review tools can enforce policies requiring prepared statements and rejecting ad-hoc SQL construction in critical financial modules.
  • At runtime, database query logging and anomaly detection can help identify unusual query patterns characteristic of boolean-based blind probing and excessive conditional complexity.

Sources

SourceLink
github.comgithub.com/FrontAccountingERP/FA/commit/647a18196caad27f96ea852e993c9e30f815357f
jivasecurity.comjivasecurity.com/writeups/frontaccounting-sqli-journal-entries-report-cve-2026-40524
sourceforge.netsourceforge.net/p/frontaccounting/news/2026/04/release-2420/
vulncheck.comvulncheck.com/advisories/frontaccounting-sql-injection-via-get-gl-transactions

Frequently asked

questions

Not necessarily. The attacker must have SA_GLANALYTIC or similar analytic permissions, but they do not need full administrative control. Any role that can trigger get_gl_transactions() with a controllable filter_type parameter may be sufficient.

Yes, if the affected reporting functionality is exposed through a web interface and reachable to authenticated users. The attack is typically carried out via crafted HTTP requests to the analytics or GL reporting endpoints.

The most robust fix is to replace all string concatenation in SQL with parameterized queries or prepared statements, combined with strict whitelisting of allowed filter values. Query construction should never depend on raw user input.

Adopt a standardized database access layer that enforces parameterization, establish secure coding guidelines for query construction, and integrate static analysis and security-focused code review into the development lifecycle to catch unsafe patterns early.

Find out what's already
exploitable in your codebase.