Summary
A critical SQL injection vulnerability in Metabase may allow an unauthenticated attacker to influence database queries through a publicly shared card or dashboard that exposes a field-filter or dimension parameter. Successful exploitation could expose, modify, or destroy data depending on the permissions of the database connection used by the affected query.
Affected context
The issue may occur in Metabase deployments where cards or dashboards are publicly shared and expose field-filter parameters. Risk is increased when those parameters are incorporated into generated SQL without sufficiently strict validation, type enforcement, or query-safe binding, and when the connected database account has broad privileges.
Exploit preconditions
- Attack surface: Publicly accessible Metabase cards or dashboards
- Required access: No Metabase authentication may be required when the affected content is publicly shared
- Trigger point: Processing a user-controlled field-filter or dimension parameter
- Why exploitation is possible: Filter input can influence database query construction in a way that may allow SQL syntax or expressions to be interpreted by the backend database
Why this happens
The vulnerability is caused by insufficient separation between user-controlled filter values and SQL query structure. When field-filter or dimension parameters are incorporated into generated queries without robust parameterization, allowlisting, and type-aware validation, crafted input may alter the intended query semantics. This behavior maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Potential impact
- An attacker may read sensitive records available to the database connection
- An attacker could bypass intended dashboard filtering and access broader datasets
- An attacker may alter or delete database records if the connection permits those operations
- An attacker could obtain database-specific information or metadata
- Application availability could be affected through resource-intensive queries
General mitigation guidance
Mitigation generally focuses on ensuring that externally supplied filter values cannot become executable SQL structure.
Common defensive patterns include:
- Using parameterized queries and trusted query-builder abstractions
- Applying strict allowlists for fields, operators, and permitted filter dimensions
- Enforcing type-aware validation and rejecting unexpected input before query generation
- Limiting public sharing of dashboards that expose dynamic database filters
- Using read-only database accounts with narrowly scoped permissions for analytics workloads
- Separating public reporting data from sensitive operational databases where practical
- Applying rate limits and resource controls to publicly accessible query endpoints
How teams detect issues like this
Organizations can look for SQL injection risks through:
- Static analysis rules identifying string concatenation or interpolation in SQL construction
- Code review checks for dynamic field, operator, or filter handling
- Tests that submit unexpected SQL metacharacters and verify that query structure remains unchanged
- Monitoring for unusual queries, schema enumeration, unexpected data volume, or repeated requests against public dashboards
- Policy enforcement requiring parameterized database access and restricted database identities
- Automated security review tools that flag unparameterized query paths and publicly exposed data endpoints

