Automated Threat Modeling

Brief Summary: Kestra CVE-2026-34612 SQL Injection to Remote Code Execution via PostgreSQL COPY TO PROGRAM

A brief summary of CVE-2026-34612, a critical SQL injection vulnerability in Kestra's flow search endpoint that escalates to remote code execution through PostgreSQL's COPY TO PROGRAM feature. It affects default docker compose deployments before version 1.3.7.

CVE Analysis

6 min read

ZeroPath CVE Analysis
ZeroPath CVE Analysis

2026-04-03

Brief Summary: Kestra CVE-2026-34612 SQL Injection to Remote Code Execution via PostgreSQL COPY TO PROGRAM
Experimental AI-Generated Content

This CVE analysis is an experimental publication that is completely AI-generated. The content may contain errors or inaccuracies and is subject to change as more information becomes available. We are continuously refining our process.

If you have feedback, questions, or notice any errors, please reach out to us.

[email protected]

Introduction

A SQL injection flaw in Kestra's flow search API escalates directly to remote code execution on the host operating system. It carries a CVSS score of 9.9. For any organization running Kestra's default docker compose deployment, an authenticated user clicking a single crafted link is all it takes for an attacker to gain OS-level command execution on the database host.

Kestra is an open-source, event-driven orchestration platform for automating scheduled and event-driven workflows across data, AI, and infrastructure. Enterprise adoption has been rapid. The platform executed over 2 billion workflows in 2025 and reported a 25x increase in enterprise revenue over 18 months. With $36M in total funding behind it, Kestra holds a growing niche in workflow orchestration, so its security posture matters to a broad set of organizations.

Technical Information

Root Cause

CVE-2026-34612 is classified under CWE-89 (Improper Neutralization of Special Elements used in an SQL Command). The vulnerability is in the GET /api/v1/main/flows/search endpoint. Kestra incorporates user-supplied input from this endpoint into a SQL query without adequate sanitization or parameterization, so an attacker can inject arbitrary SQL statements.

The PostgreSQL Escalation Path

The execution mechanism is what makes this vulnerability so severe. The injected SQL goes beyond extracting or changing data. It uses PostgreSQL's COPY ... TO PROGRAM ... functionality, a well-known feature that lets the database pipe query output to an operating system command. Legitimate uses include exporting data to external tools. In an attacker's hands, it is a direct bridge from SQL injection to arbitrary OS command execution on the host where PostgreSQL runs.

The default docker compose deployment is explicitly noted as vulnerable, so organizations that followed the standard setup documentation are exposed without any additional misconfiguration.

Attack Flow

Based on the available advisory details, exploitation proceeds in this order:

  1. The attacker first needs valid credentials for the Kestra platform. They could get them through credential theft, brute force, or a legitimate but low-privilege account.

  2. The attacker crafts a malicious URL targeting the GET /api/v1/main/flows/search endpoint, with SQL injection payloads embedded in one or more of the query parameters the search functionality uses.

  3. An authenticated user visits the crafted link. That could be the attacker, if they have credentials, or a legitimate user tricked into clicking it through phishing or social engineering.

  4. The Kestra backend processes the request and passes the unsanitized input into a SQL query executed against the PostgreSQL database.

  5. The injected SQL uses COPY ... TO PROGRAM ... to make PostgreSQL run an arbitrary operating system command on the host. The attacker now has remote code execution with the privileges of the PostgreSQL process.

The commit message for the fix refers to "SQL injection vulnerabilities in label search," which narrows down where in the search functionality the injection point sits.

Impact

Successful exploitation lets the attacker run arbitrary commands on the host system. From there, the standard post-exploitation options open up: establishing persistence, moving laterally within the network, exfiltrating data, or deploying additional payloads. The target is an orchestration platform, which by design connects to numerous downstream systems and services, and that makes the blast radius considerably larger.

Affected Systems and Versions

The vulnerability affects Kestra deployments with the following characteristics:

  • Versions: All versions prior to 1.3.7
  • Deployment configuration: Default docker compose deployments are explicitly confirmed as vulnerable
  • Database backend: PostgreSQL (required for the COPY ... TO PROGRAM ... escalation path)
  • Fixed version: 1.3.7

Organizations should check both their Kestra version and their deployment method. The fix is available in version 1.3.7.

Vendor Security History

Kestra's GitHub security advisories show a pattern of input validation issues, concentrated in early 2026:

AdvisoryVulnerability TypeSeverityDate
GHSA-365w-2m69-mp9xRemote Code Execution via SQL InjectionCriticalMarch 30, 2026
GHSA-v2mc-8q95-g7hpStored Cross Site Scripting via Flow YAML FieldsHighMarch 23, 2026
GHSA-r36c-83hm-pc8jStored Cross Site Scripting in Markdown File PreviewHighMarch 3, 2026
GHSA-qpj4-4r6r-wvf4Stored XSS in Kestra below 0.22ModerateJuly 7, 2025

Three advisories in a single month, all tied to insufficient input handling, suggest a systemic gap in input validation across the codebase. Organizations using Kestra should factor this track record into their risk assessments and patch this platform aggressively.

References

Detect & fix
what others miss

Works with
  • GitHub
  • GitLab
  • Bitbucket
  • Azure DevOps Services
  • Gerrit
  • CVS
  • Jira
  • Linear
  • Slack
  • Security Compass
Explore integrations
Security magnifying glass visualization