CVE-2026-61852: Chartbrew: SQL Injection via row_limit Parameter in AI runQuery Tool
Chartbrew is an open-source web application that can connect directly to databases and APIs and use the data to create charts. Prior to 5.2.2, Chartbrew's runQuery() implementation in server/modules/ai/orchestrator/tools/runQuery.js interpolates the AI tool's rowlimit parameter into a SQL LIMIT clause without runtime integer validation. The read-only keyword check runs before this value is appended, so an authenticated user who can influence a model-generated non-integer rowlimit can add SQL that bypasses the earlier check. Successful exploitation can execute arbitrary statements against the connected database, including reading or changing data and, where database permissions permit, accessing files or executing operating-system commands. This issue is fixed in version 5.2.2.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
chartbrewto a version that resolves this vulnerability.Fixed in 5.2.2
Event History
Frequently Asked Questions
Who can exploit this issue?
An authenticated user must be able to influence a model-generated non-integer row_limit value used by the AI runQuery tool. The vulnerable code is in Chartbrew deployments prior to version 5.2.2 that use this functionality with a connected database.
What is the potential impact on the connected database?
An attacker can append SQL after the read-only keyword check and execute arbitrary statements against the connected database. This can include reading or modifying data and, if the database account permits it, accessing files or executing operating-system commands.
What should teams do if they cannot immediately upgrade?
The provided data identifies version 5.2.2 as the fix. Until upgrading, limit access to authenticated users who can influence AI tool inputs and ensure the database credentials used by Chartbrew have only the minimum required permissions.