Executive brief
FrontAccounting, an open-source enterprise resource planning (ERP) system, contains a security flaw in its bank statement reporting feature. An authorized user can exploit this flaw to trick the system into revealing sensitive information from the database, such as other users' login credentials and email addresses. This data is then delivered to the attacker inside a standard-looking PDF report, potentially leading to full account takeovers and unauthorized access to financial records.
Technical details
A UNION-based SQL injection vulnerability exists in FrontAccounting's reporting engine, specifically within 'reporting/rep601.php' (the Bank Statement report). The application fails to sanitize or parameterize the 'PARAM_0' POST parameter before concatenating it into a WHERE clause in a SQL query targeting the 'bank_accounts' table. An authenticated attacker with 'SA_BANKREP' permissions can inject 'UNION SELECT' payloads to exfiltrate sensitive data, including unsalted MD5 password hashes from the 'users' table. The results of the malicious query are rendered directly into the generated PDF report output. The vulnerability is addressed in version 2.4.20 by implementing proper database escaping using 'db_escape()'.
Affected products
- FrontAccounting FrontAccounting before 2.4.20
Timeline
- 2026-04-17: patched: Initial fix committed to repository
- 2026-04-24: advisory: Release 2.4.20 announcement published on SourceForge
- 2026-06-29: disclosed: CVE-2026-40522 published to NVD
References
- https://github.com/FrontAccountingERP/FA/commit/894adaf71393e0ef6a04fe6036fcd2464050f590
- https://jivasecurity.com/writeups/frontaccounting-sqli-bank-statement-report-cve-2026-40522
- https://sourceforge.net/p/frontaccounting/news/2026/04/release-2420/
- https://www.vulncheck.com/advisories/frontaccounting-sql-injection-via-rep601-php