/

CVE-2026-54349

Severity:

CRITICAL RISK

(9.8)

SQL Injection (CWE-89) in Chartbrew Dashboard Variables

CVE-2026-54349

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Unauthorized database access or modification

Severity:

CRITICAL RISK

(9.8)

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

Chartbrew's SQL dashboard-variable substitution can let crafted URL filter values alter a stored query used by a public or embedded chart. An unauthenticated user may be able to inject SQL, with a separate backslash-escaping issue affecting quoted MySQL and MariaDB contexts.

Affected context

The vulnerable surface is public and embedded chart requests that use URL-controlled variables in stored SQL queries and call applyMysqlOrPostgresVariables. Unsafe handling of JavaScript replacement-string sequences can affect SQL across connectors; separately, missing backslash escaping creates a quoted-string escape path for MySQL and MariaDB. The risk depends on a chart exposing such variables and on the permissions of its configured database account.

Exploit preconditions

  • Attack surface: A public or embedded chart request that applies URL-controlled variables to a stored SQL query.
  • Required access: No authentication is required when the target chart is publicly accessible or embedded in a way that permits the request.
  • Trigger point: Variable substitution while processing the chart request.
  • Why exploitation is possible: Replacement-string sequences can alter SQL independently of the database engine; in quoted MySQL or MariaDB contexts, unescaped backslashes provide an additional escape path.

Why this happens

The application substitutes attacker-controlled values into SQL using JavaScript replacement strings without safely handling their special replacement sequences. For MySQL and MariaDB quoted contexts, it also fails to escape backslashes. This is CWE-89: SQL Injection: untrusted input is incorporated into a SQL statement in a way that can change its intended structure.

Potential impact

  • An attacker may read data accessible to the configured database account.
  • An attacker could modify or delete accessible database records.
  • The confidentiality, integrity, or availability of data used by the application may be affected.
  • The impact may be limited or expanded by the database account's permissions.

General mitigation guidance

Defensive patterns focus on keeping untrusted values separate from SQL syntax. Parameterized queries or safely bound variables are preferable to string-based SQL substitution. Where dynamic query elements are necessary, applications can validate them against explicit schemas and allowlists, and apply context- and database-dialect-aware handling rather than relying on generic escaping. Public and embedded charts can also be configured to expose only necessary variables and use database accounts with least privilege.

How teams detect issues like this

  • Use static analysis to identify SQL construction involving string replacement or concatenation with request-controlled values.
  • Review code paths that process URL filters, especially JavaScript replacement-string handling and database-specific quoting or escaping.
  • Enforce policies that favor parameterized queries and restrict unsafe dynamic SQL patterns.
  • Test public and embedded chart variable flows with security-focused checks, without relying solely on database-specific protections.

Sources

SourceLink
github.comgithub.com/chartbrew/chartbrew/commit/f93d31ac586091f72a7eb97d89fa3b4db271bd24
github.comgithub.com/chartbrew/chartbrew/releases/tag/v5.2.1
github.comgithub.com/chartbrew/chartbrew/security/advisories/GHSA-4wj7-9gq7-mrr2

Frequently asked

questions

Public or embedded chart requests are in scope when they apply URL-controlled variables to a stored SQL query.

Not when the target chart is publicly accessible or its embedded request can be made without authentication. The database account used by the chart determines which data and operations are exposed.

Keep values separate from SQL syntax through parameterized queries or safely bound variables, and strictly constrain any dynamic query elements.

Review all paths from request parameters to SQL, enforce secure query-construction policies, and account for database-specific quoting behavior in security testing.

Find out what's already
exploitable in your codebase.