Summary
OpenPanel contains an SQL injection flaw in its analytics filter builder, where profile filter column identifiers are interpolated into ClickHouse WHERE clauses without adequate validation. An authenticated attacker with project-scoped read access or root export credentials may bypass project isolation and use blind boolean techniques to access analytics data and profile-related personally identifiable information.
Affected context
The vulnerability occurs in OpenPanel analytics workflows that construct ClickHouse queries from profile.* filter column identifiers. It becomes risky when an authenticated user can submit or influence analytics filters and the application inserts those identifiers into query text without restricting them to an approved set. The exposure depends on the permissions granted to the account and the isolation controls surrounding analytics data.
Exploit preconditions
- Attack surface: Authenticated analytics filter or export functionality
- Required access: Project-scoped read access or root export credentials
- Trigger point: Processing a filter whose profile column identifier is incorporated into a ClickHouse WHERE clause
- Why exploitation is possible: Unvalidated identifiers are treated as query syntax, allowing attacker-controlled expressions to influence database evaluation and reveal information through response behavior
Why this happens
The underlying bug is a failure to distinguish trusted column identifiers from untrusted request data before constructing a database query. Interpolating user-controlled identifiers into ClickHouse SQL can allow SQL syntax to alter the intended predicate, which maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command (SQL Injection). The issue is particularly significant when authorization and tenant boundaries are enforced only through the generated query.
Potential impact
- An attacker may bypass intended project or organization isolation
- Sensitive analytics records could be disclosed
- Profile-related personally identifiable information could be inferred or accessed
- Blind boolean query behavior could enable incremental data inference
- Trust in tenant-level access controls could be weakened
General mitigation guidance
Mitigation generally focuses on preventing user-controlled identifiers from becoming executable SQL structure.
Common defensive patterns include:
- Restricting filter columns to a server-defined allowlist of valid identifiers
- Separating identifiers from values and using parameterized query mechanisms where supported
- Rejecting unexpected syntax, operators, and identifier formats before query construction
- Enforcing tenant and organization authorization independently of client-supplied filters
- Applying least privilege to analytics and export database identities
- Returning uniform responses and limiting query behavior that could act as a data oracle
- Minimizing the sensitivity and scope of data exposed through analytics endpoints
How teams detect issues like this
Detection approaches commonly include:
- Static analysis for string interpolation, concatenation, or formatting of request-controlled values into SQL statements
- Code review checks for dynamic column names and filter builders lacking allowlist validation
- Database query monitoring for unexpected predicates, operators, or access patterns across tenant boundaries
- Policy enforcement requiring parameterization or approved query-builder abstractions
- Authorization tests that verify project-scoped accounts cannot query data belonging to other organizations
- Automated security review tools that flag untrusted input reaching database execution paths

