Summary
Kestra versions v1.3.3 and earlier contain a SQL injection vulnerability where user-supplied GET parameters are directly concatenated into SQL queries without proper safeguards.
Under these conditions, an attacker can inject arbitrary SQL expressions into the underlying database query, potentially leading to data exfiltration, modification, or complete compromise of the application's data layer.
Affected context
This vulnerability affects deployments of Kestra up to and including v1.3.3 that expose HTTP endpoints taking query parameters and use them in database operations.
The issue arises in code paths where GET parameter values are incorporated into SQL strings directly, without using prepared statements or adequate validation.
It is most relevant in environments where the application's database account has broad privileges, and where the affected endpoints are reachable to untrusted or semi-trusted users.
Exploit preconditions
- Attack surface: HTTP endpoints that accept GET parameters used within SQL queries.
- Required access: Network-level access to the vulnerable Kestra instance; no special privileges are assumed if the endpoint is publicly reachable.
- Trigger point: Submission of crafted GET query parameters that are concatenated into dynamic SQL strings.
- Why exploitation is possible: The application constructs SQL statements by directly embedding user input without parameterization or robust input validation, allowing attacker-controlled SQL syntax to alter the intended query logic.
Why this happens
The root cause is the use of dynamically constructed SQL queries that directly embed user-controlled data from GET parameters.
Instead of using parameterized queries or prepared statements, the application concatenates raw input into the SQL string, which maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
This pattern treats external input as trusted and part of the executable SQL syntax, enabling attackers to inject additional clauses, modify query structure, or combine multiple statements depending on database configuration.
Potential impact
- Unauthorized reading of sensitive data from database tables.
- Modification or deletion of records, including critical configuration or workflow data.
- Escalation of privileges within the application by tampering with user or role tables.
- Denial of service by corrupting schema or issuing resource-intensive queries.
- Potential execution of database-specific functions that can interact with the file system or network, depending on DBMS capabilities and permissions.
General mitigation guidance
Mitigations generally focus on eliminating the direct concatenation of user input into SQL and tightening trust boundaries around query construction.
Common defensive patterns include:
- Using parameterized queries or prepared statements for all database interactions involving external input.
- Applying strict input validation and whitelisting for expected parameter formats (e.g., integers, fixed enums, or known identifiers).
- Encapsulating database access in a data access layer that forbids raw SQL string assembly from request parameters.
- Minimizing database account privileges so that even if a query is manipulated, the scope of possible damage is reduced.
- Adopting secure-by-default frameworks or ORM layers that discourage or block ad-hoc string-based query construction.
How teams detect issues like this
Detection efforts typically combine code-centric and runtime perspectives:
- Static analysis: Configure rules to flag string concatenation used to build SQL statements, especially where request parameters or query strings are involved.
- Code review: Look for patterns where HTTP GET parameters are passed directly into query builder methods or concatenated into raw SQL, and verify use of placeholders and bind variables.
- Logging and monitoring: Enable detailed query logging (with care for sensitive data) to detect anomalous patterns like injected operators, tautologies, or unexpected UNION/ORDER BY segments.
- Security testing: Incorporate automated and manual SQL injection tests into CI pipelines and pre-release security assessments, including fuzzing endpoints that accept query parameters.

