Executive brief
Frappe, a web application framework, contained a security flaw where its database query safety checker failed to block commands that export data to files. On self-hosted systems with specific database configurations, a logged-in user could potentially use this to write data to the server's file system. This could lead to unauthorized data exports or local file creation if the database service has excessive permissions.
Technical details
A SQL injection vulnerability exists in the Frappe Framework's 'check_safe_sql_query' utility. Prior to the fix, the function's blacklist did not account for 'SELECT INTO OUTFILE' or 'DUMPFILE' statements, which are used to export query results to the server's local file system. An attacker with low-level privileges (PR:L) could execute these queries in restricted contexts if the underlying MySQL/MariaDB user has the 'FILE' privilege and directory permissions are poorly aligned. The vulnerability is addressed by adding regex-based validation to block these export keywords in 'frappe/utils/safe_exec.py'.
Affected products
- Frappe Frappe Framework < 15.108.0, >= 16.0.0-beta.1, < 16.18.3
Timeline
- 2026-05-18: patched: Fixes merged into version 15 and 16 hotfix branches
- 2026-05-20: advisory: Release notes for 15.108.0 and 16.18.3 published
- 2026-07-10: disclosed: CVE-2026-47199 published to NVD
References
- https://github.com/frappe/frappe/commit/628e103f7ffe307447d9fc9e2c572cbddedfa3b5
- https://github.com/frappe/frappe/commit/91d3ded038d1c901b73f4a2293e134d691c1662d
- https://github.com/frappe/frappe/pull/39345
- https://github.com/frappe/frappe/pull/39346
- https://github.com/frappe/frappe/releases/tag/v15.108.0
- https://github.com/frappe/frappe/releases/tag/v16.18.3
- https://github.com/frappe/frappe/security/advisories/GHSA-wx8j-cw4r-vrhv