CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-9Q4R-4842-93VW

GHSA-9Q4R-4842-93VW: Cross-Tenant SQL Injection in Trigger.dev TSQL Query Compiler

Alon Barad
Alon Barad
Software Engineer

Oct 3, 2026·6 min read·12 visits

Executive Summary (TL;DR)

Authenticated cross-tenant SQL injection in Trigger.dev via unsanitized window-function names in the TSQL compiler allows unauthorized extraction of other organizations' data.

A critical cross-tenant SQL injection vulnerability exists in the TSQL query compiler of Trigger.dev, allowing authenticated users to bypass tenant isolation boundaries and read arbitrary ClickHouse analytics logs and execution payloads belonging to other organizations.

Vulnerability Overview

The Trigger.dev platform implements a custom query language interface (TSQL/TRQL) exposed at the POST /api/v1/query endpoint to allow developers to query task execution analytics and run logs. This query language undergoes compilation into raw ClickHouse SQL through an internal parsing and printing package (internal-packages/tsql).

While the compiler applies sanitization, parameter binding, and mandatory tenant-scoping filters to standard queries, it fails to sanitize or validate window function names. This omission exposes an attack surface where any authenticated user can bypass tenant boundaries and exfiltrate database records belonging to other tenants.

This vulnerability is classified under CWE-89 (Improper Neutralization of Special Elements used in an SQL Command) and CWE-639 (Authorization Bypass Through User-Controlled Key). The flaw permits direct read-access to the underlying ClickHouse database containing sensitive customer payloads, environment variables, and execution parameters.

Root Cause Analysis

The root cause of the vulnerability lies in the implementation of the visitWindowFunction AST node printer within internal-packages/tsql/src/query/printer.ts. When formatting window functions for the final ClickHouse query, the printer directly concatenates the node.name property into the raw SQL string without any escaping or validation checks.

While typical SQL functions are restricted to an allowlist of valid names, the TSQL compiler does not enforce such constraints for window functions. Furthermore, the TSQL lexer permits backtick-quoted identifiers, which are intended to let developers use special characters in column names. When processing backticks, the lexer strips the quotes and unescapes the inner string, passing the raw string as the function name to the AST.

By enclosing a malicious SQL fragment containing a subquery within backticks in the window function position, an attacker can break out of the analytical query context. The automatically generated tenant isolation guard (enforcedWhereClause) is only applied to the WHERE clause of the outer table. The injected subquery executes within the SELECT context as an independent expression, entirely unaffected by the outer query's isolation limits.

Code Analysis

The vulnerable code path handles the WindowFunction AST node by generating an unvalidated string representation of the function call. Below is the code implementation prior to the fix:

// Vulnerable implementation in internal-packages/tsql/src/query/printer.ts
private visitWindowFunction(node: WindowFunction): string {
  const args = node.args ? node.args.map((a) => this.visit(a)) : [];
  // node.name is concatenated directly into the query string without sanitization
  const funcCall = `${node.name}(${args.join(", ")})`;
 
  if (node.over_identifier) {
    return `${funcCall} OVER ${this.printIdentifier(node.over_identifier)}`;
  }
  // ...
}

In the patched version, the maintainers introduced strict allowlist validation using findTSQLFunction and findTSQLAggregation. This validation maps the input function name against a registry of safe analytical functions and retrieves the corresponding safe ClickHouse name:

// Patched implementation in internal-packages/tsql/src/query/printer.ts
private visitWindowFunction(node: WindowFunction): string {
  // Validate the function name against the allowlist and resolve it to its safe ClickHouse name
  const funcMeta = findTSQLFunction(node.name) ?? findTSQLAggregation(node.name);
  if (!funcMeta) {
    throw new QueryError(`Unknown function: ${node.name}`);
  }
 
  const args = node.args ? node.args.map((a) => this.visit(a)) : [];
  const funcCall = `${funcMeta.clickhouseName}(${args.join(", ")})`;
 
  if (node.over_identifier) {
    return `${funcCall} OVER ${this.printIdentifier(node.over_identifier)}`;
  }
  // ...
}

This remediation completely closes the vulnerability by rejecting any unauthorized or malformed window function name prior to database execution.

Exploitation Methodology

An exploitation flow requires the attacker to possess valid standard API credentials or a JWT to authenticate to the POST /api/v1/query endpoint. This prerequisite is low-complexity since any legitimate tenant on a self-hosted or cloud-hosted instance of Trigger.dev can perform the request.

The attacker constructs a TSQL payload targeting their own task_runs table, which satisfies the initial authorization checks. Inside the projection list of the SELECT statement, the attacker introduces a window function definition with a name enclosed in backticks. The backtick string encapsulates the malicious subquery payload.

During processing, the compiler compiles this node into a raw ClickHouse subquery. Because ClickHouse executes subqueries in the SELECT list independently, the database retrieves records from other tables (e.g., trigger_dev.task_runs_v2) for any specified organization_id. The resulting dataset containing the exfiltrated sensitive data is mapped to an alias and returned in the HTTP response.

Here is a sequence diagram of the exploitation process:

Impact Assessment

The security impact of this vulnerability is significant, as it completely breaks the multi-tenant isolation model of Trigger.dev. An attacker can run arbitrary read-only queries against the analytical database, compromising the confidentiality of all tenant data stored within the ClickHouse instance.

This data includes historical task runs, execution payloads, logs, internal environment variables, API secret keys, and customer database passwords processed during job executions. In worst-case scenarios, the exposed payloads can leak highly sensitive credentials, leading to secondary compromises of connected systems.

Since this is an SQL injection targeting ClickHouse, write operations or local file system access are generally restricted by the database engine permissions. However, the complete disclosure of execution records makes this a high-severity incident with CVSS score 7.7 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N).

Remediation & Detection Guidance

To remediate this vulnerability, self-hosted and cloud operators must immediately upgrade their deployments to version 4.5.6 or later. This release incorporates the official validation patch that terminates compilation if an unrecognized window function name is supplied.

In environments where upgrading is delayed, Web Application Firewalls (WAFs) can be deployed to inspect traffic hitting the POST /api/v1/query endpoint. Security teams should implement rules to search the query payload for backticks combined with typical SQL keywords such as SELECT, FROM, or WHERE within the identifier block.

Additionally, database logs for ClickHouse should be continuously audited for queries executing against the task_runs_v2 table that contain mismatching organization_id fields or multiple nested SELECT queries containing the string OVER with non-standard functions.

Technical Appendix

CVSS Score
7.7/ 10
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N

Affected Systems

Trigger.dev self-hosted platformsTrigger.dev cloud service

Affected Versions Detail

Product
Affected Versions
Fixed Version
trigger.dev
Trigger.dev
<= 4.5.54.5.6
AttributeDetail
CWE IDCWE-89, CWE-639
Attack VectorNetwork
CVSS Score7.7 (High)
Exploit StatusProof of Concept (PoC) available
KEV StatusNot Listed
ImpactCross-tenant data exfiltration

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1005Data from Local System
Collection
T1119Automated Collection
Collection
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

The software constructs an SQL command using unsanitized input that allows an attacker to alter the query structure.

Known Exploits & Detection

GitHub Security AdvisoryContains detailed instructions and full TSQL query payload demonstrating cross-tenant exfiltration

Vulnerability Timeline

Vulnerability reported internally / security advisory drafted
2026-07-08
Patch developed and committed to repository
2026-07-21
Security advisory published to GitHub Advisory Database
2026-10-02

References & Sources

  • [1]GitHub Security Advisory GHSA-9q4r-4842-93vw
  • [2]Repository Advisory for GHSA-9q4r-4842-93vw
  • [3]Fix Pull Request #4316
  • [4]Fix Patch Commit 6997aeb05e27d2db47f9eda01fdc8a17c81a1ae0
  • [5]Release Tag v4.5.6

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•1 day ago•CVE-2026-107844
5.3

CVE-2026-107844: Path Traversal Vulnerability in Contao ImagesController

A path traversal vulnerability (CWE-22) in Contao CMS allows unauthenticated remote attackers to bypass directory boundary restrictions in ImagesController and access files within the project directory.

Amit Schendel
Amit Schendel
8 views•5 min read
•1 day ago•CVE-2026-107848
3.5

CVE-2026-107848: Cross-Site Request Forgery (CSRF) in Contao Backend Actions via GET Requests

Contao Open Source CMS versions 4.0.0 through 5.3.49 and 5.4.0-RC1 through 5.7.11 contain a Cross-Site Request Forgery (CSRF) vulnerability in backend parameter handling. The `RequestTokenListener` component validates anti-CSRF tokens solely for HTTP POST requests, while GET-based declarative guards run only when an `act` parameter is present in the query string. Consequently, custom backend actions dispatched via alternative parameters such as `key=` can execute without CSRF token verification when triggered by an authenticated user.

Amit Schendel
Amit Schendel
7 views•5 min read
•1 day ago•CVE-2026-107843
5.3

CVE-2026-107843: Unthrottled Activation Email Resend and Account Enumeration in Contao CMS

Contao CMS versions 4.1.0 through 5.3.49 and 5.4.0-RC1 through 5.7.11 fail to validate form submission tokens and enforce rate limiting when processing activation email resend requests via HTTP POST, enabling resource exhaustion and account state enumeration.

Amit Schendel
Amit Schendel
8 views•4 min read
•1 day ago•CVE-2026-107842
5.3

CVE-2026-107842: Information Disclosure via Stale Indexing in Contao Search Module

An information disclosure vulnerability in Contao CMS allows unauthenticated site visitors to view protected page titles, URLs, and text excerpts through search queries when protected page indexing is disabled after previously being enabled.

Amit Schendel
Amit Schendel
10 views•4 min read
•1 day ago•GHSA-G38J-7V97-X298
6.5

GHSA-G38J-7V97-X298: Missing Authorization Check in Vikunja CalDAV Task Relation Creation

In Vikunja prior to version 2.6.0, relation creation via the CalDAV endpoint fails to invoke the TaskRelation.CanCreate authorization check. This missing access control allows an authenticated user to establish unauthorized relationships and perform write operations against any task, provided its unique identifier (UID) is known.

Alon Barad
Alon Barad
12 views•5 min read
•1 day ago•GHSA-3HC7-R24J-RPWC
6.8

GHSA-3hc7-r24j-rpwc: Cross-Project Task Disclosure via Subtask Expansion in Vikunja

A cross-project information disclosure vulnerability in Vikunja allows authenticated users with read access to one project to view private task details from unauthorized projects via subtask expansion parameters.

Alon Barad
Alon Barad
9 views•5 min read