/

CVE-2026-114081

Severity:

HIGH RISK

(7.7)

SQL Injection (CWE-89) in Trigger.dev TSQL Compiler

CVE-2026-114081

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Cross-Tenant Data Disclosure

Severity:

HIGH RISK

(7.7)

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

Trigger.dev contains a SQL injection vulnerability in its TSQL query compiler, which inserts window-function names into generated ClickHouse SQL without sufficient allowlisting or escaping.

An authenticated customer may be able to manipulate a query submitted through the query API and access analytics data belonging to other organizations when tenant filtering is bypassed.

Trigger.dev contains a SQL injection vulnerability in its TSQL query compiler, which inserts window-function names into generated ClickHouse SQL without sufficient allowlisting or escaping.

An authenticated customer may be able to manipulate a query submitted through the query API and access analytics data belonging to other organizations when tenant filtering is bypassed.

Affected context

The vulnerability occurs in Trigger.dev deployments that use the affected TSQL query compiler to generate ClickHouse queries. It becomes risky when authenticated customers can control window-function identifiers and the compiler concatenates those values into SQL without enforcing a restricted identifier set or applying context-appropriate escaping.

The vulnerability occurs in Trigger.dev deployments that use the affected TSQL query compiler to generate ClickHouse queries. It becomes risky when authenticated customers can control window-function identifiers and the compiler concatenates those values into SQL without enforcing a restricted identifier set or applying context-appropriate escaping.

Exploit preconditions

  • Attack surface: The authenticated query API and its TSQL-to-ClickHouse query compilation path
  • Required access: An authenticated customer account with permission to submit analytics queries
  • Trigger point: Processing a customer-controlled window-function name during SQL generation
  • Why exploitation is possible: Untrusted identifier data is concatenated into SQL, allowing query structure to be altered and tenant-scoping protections to be bypassed
  • Attack surface: The authenticated query API and its TSQL-to-ClickHouse query compilation path
  • Required access: An authenticated customer account with permission to submit analytics queries
  • Trigger point: Processing a customer-controlled window-function name during SQL generation
  • Why exploitation is possible: Untrusted identifier data is concatenated into SQL, allowing query structure to be altered and tenant-scoping protections to be bypassed

Why this happens

The underlying bug is unsafe construction of SQL statements from untrusted input. Window-function names are treated as trusted SQL fragments rather than being restricted to a predefined set of valid identifiers.

This behavior maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command (SQL Injection). The absence of strict allowlisting and context-aware query construction permits attacker-controlled input to change the meaning of generated ClickHouse SQL.

The underlying bug is unsafe construction of SQL statements from untrusted input. Window-function names are treated as trusted SQL fragments rather than being restricted to a predefined set of valid identifiers.

This behavior maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command (SQL Injection). The absence of strict allowlisting and context-aware query construction permits attacker-controlled input to change the meaning of generated ClickHouse SQL.

Potential impact

  • An authenticated customer may access analytics data belonging to other organizations
  • Tenant-isolation guarantees could be weakened or bypassed
  • Confidential business metrics and query results may be disclosed
  • Crafted queries could increase database resource consumption
  • An authenticated customer may access analytics data belonging to other organizations
  • Tenant-isolation guarantees could be weakened or bypassed
  • Confidential business metrics and query results may be disclosed
  • Crafted queries could increase database resource consumption

General mitigation guidance

Mitigation generally focuses on preventing user-controlled values from becoming executable SQL syntax.

Common defensive patterns include:

  • Allowlisting window functions and mapping accepted names to fixed internal SQL expressions
  • Using structured query builders or parameterized query mechanisms where supported
  • Separating identifiers from values and applying context-specific escaping only where unavoidable
  • Enforcing tenant predicates independently of customer-controlled query fragments
  • Applying authorization and least-privilege controls at the database and application layers
  • Limiting returned fields and query scope according to the authenticated tenant

Mitigation generally focuses on preventing user-controlled values from becoming executable SQL syntax.

Common defensive patterns include:

  • Allowlisting window functions and mapping accepted names to fixed internal SQL expressions
  • Using structured query builders or parameterized query mechanisms where supported
  • Separating identifiers from values and applying context-specific escaping only where unavoidable
  • Enforcing tenant predicates independently of customer-controlled query fragments
  • Applying authorization and least-privilege controls at the database and application layers
  • Limiting returned fields and query scope according to the authenticated tenant

How teams detect issues like this

Organizations can look for:

  • Static analysis findings involving string concatenation or interpolation of request data into SQL
  • Code review signals such as dynamic identifiers without allowlists or query construction performed outside a trusted query builder
  • Tests that verify tenant predicates remain mandatory when optional query clauses are supplied
  • Database audit records showing unexpected subqueries, cross-tenant access patterns, or unusual query shapes
  • API policy enforcement that constrains query grammar and permitted analytical functions

Automated security review tools may help identify risky SQL construction patterns, but database-level monitoring and authorization tests should complement source analysis.

Organizations can look for:

  • Static analysis findings involving string concatenation or interpolation of request data into SQL
  • Code review signals such as dynamic identifiers without allowlists or query construction performed outside a trusted query builder
  • Tests that verify tenant predicates remain mandatory when optional query clauses are supplied
  • Database audit records showing unexpected subqueries, cross-tenant access patterns, or unusual query shapes
  • API policy enforcement that constrains query grammar and permitted analytical functions

Automated security review tools may help identify risky SQL construction patterns, but database-level monitoring and authorization tests should complement source analysis.

Sources

SourceLink
github.comgithub.com/triggerdotdev/trigger.dev/security/advisories/GHSA-9q4r-4842-93vw
vulncheck.comvulncheck.com/advisories/trigger-dev-before-4.5.6-cross-tenant-sql-injection-via-tsql-window-function-name

Frequently asked

questions

It can be exploitable through the query API by an authenticated customer when the deployment exposes the affected query compilation path.

An attacker generally needs valid customer authentication and permission to submit analytics queries. Anonymous access is not required for the described attack scenario.

Restrict dynamic function names to a fixed allowlist and generate SQL from trusted expressions or structured query APIs rather than concatenating request-controlled text.

Combine parameterized query construction, strict tenant-boundary tests, least-privilege database permissions, input validation, and monitoring for anomalous cross-tenant query behavior.

It can be exploitable through the query API by an authenticated customer when the deployment exposes the affected query compilation path.

An attacker generally needs valid customer authentication and permission to submit analytics queries. Anonymous access is not required for the described attack scenario.

Restrict dynamic function names to a fixed allowlist and generate SQL from trusted expressions or structured query APIs rather than concatenating request-controlled text.

Combine parameterized query construction, strict tenant-boundary tests, least-privilege database permissions, input validation, and monitoring for anomalous cross-tenant query behavior.

Find out what's already
exploitable in your codebase.