Skip to content

Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') in snuba

Critical
oioki published GHSA-5r6f-q5fc-7r23 Jul 16, 2026

Package

pip snuba (pip)

Affected versions

>= 26.3.0, < 26.7.0

Patched versions

26.7.0

Description

Impact

Snuba is a core component of every Sentry deployment. A vulnerability in its Events Analytics Platform (EAP) query layer allowed certain user-supplied attribute input to be handled unsafely when building queries for the backing ClickHouse database. As a result, an authenticated user could cause unintended queries to run against the analytics store. On multi-tenant deployments this could lead to unauthorized access to data belonging to other organizations.

The affected code path is only reachable when the EAP array-attribute feature is enabled (the Sentry feature organizations:trace-item-details-array-fields). This feature is not enabled by default in self-hosted Sentry, so a default self-hosted installation is not exposed unless the feature has been explicitly turned on.

On SaaS (https://sentry.io) this vulnerability was patched on 2026-07-13, there was no indications that this issue was abused.

Patches

The issue is resolved in snuba 26.7.0 and self-hosted 26.7.0, which reworks the affected query path so attribute input is handled safely. Operators should upgrade to 26.7.0 or later. No configuration changes are required after upgrading.

Workarounds

If upgrading immediately is not possible:

  • Ensure the array-attribute feature is not enabled — i.e. leave organizations:trace-item-details-array-fields disabled. This is the default in self-hosted Sentry; it is controlled through SENTRY_FEATURES in your Sentry configuration, not through a UI setting.
  • Restrict the ClickHouse account used for user-facing queries to read-only to limit potential impact.

These reduce exposure but are not a substitute for upgrading.

References

Severity

Critical

CVE ID

No known CVE

Weaknesses

Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data. Learn more on MITRE.

Credits