GHSA-9q4r-4842-93vw: Trigger.dev: Cross-tenant SQL injection in the TSQL query compiler (POST /api/v1/query) via unsanitized window-function name
A cross-tenant SQL injection in the TSQL query compiler lets any authenticated trigger.dev customer read every other tenant’s analytics data. The customer-facing query endpoint POST /api/v1/query accepts a TSQL/TRQL query that is compiled to ClickHouse SQL by internal-packages/tsql. The compiler parameterizes or escapes all user input and injects a per-tenant WHERE guard — except the window-function name, which is concatenated into the SQL string with no allowlist and no escaping. By smuggling a backtick-quoted identifier into that position, an attacker injects a raw subquery (e.g. (SELECT ... FROM task_runs_v2 WHERE organization_id = 'org_VICTIM')) that sits outside the tenant guard, exfiltrating another organization’s rows. Verified end-to-end against the real compiler and a live ClickHouse.
References
- github.com/advisories/GHSA-9q4r-4842-93vw
- github.com/triggerdotdev/trigger.dev/commit/6997aeb05e27d2db47f9eda01fdc8a17c81a1ae0
- github.com/triggerdotdev/trigger.dev/pull/4316
- github.com/triggerdotdev/trigger.dev/releases/tag/v4.5.6
- github.com/triggerdotdev/trigger.dev/security/advisories/GHSA-9q4r-4842-93vw
Code Behaviors & Features
Detect and mitigate GHSA-9q4r-4842-93vw with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →