Remote code execution via SQL code generation injection in Apache Flink
CVE-2026-35194 is a code injection vulnerability in Apache Flink’s SQL code generation pipeline affecting Apache Flink 1.15.0 through 1.20.x and 2.0.0 through 2.x before the fixed releases 1.20.4, 2.0.2, 2.1.2, and 2.2.1. The flaw occurs because user-controlled strings from SQL queries are interpolated into generated Java code without proper escaping. This allows an attacker to break out of intended string literals and inject arbitrary Java expressions during Flink’s SQL-to-Java code generation process. The issue specifically affects JSON functions starting in 1.15.0 and LIKE expressions with ESCAPE clauses starting in 1.17.0. An authenticated user with query submission privileges can exploit the vulnerability by submitting a maliciously crafted SQL query, resulting in arbitrary code execution on TaskManager nodes.
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
Successful exploitation allows arbitrary code execution on Apache Flink TaskManagers. In practice, this can enable compromise of processing nodes, unauthorized access to data handled by Flink jobs, manipulation of job behavior and results, and potentially broader cluster compromise or lateral movement from the TaskManager context. The issue is especially severe in multi-tenant or shared Flink environments because non-administrative users who can submit queries may be able to execute attacker-controlled code on backend worker nodes.
If you can’t patch tonight, do this now.
If immediate patching is not possible, restrict query submission privileges to trusted users only, reduce exposure of Flink SQL interfaces, and closely monitor submitted SQL for anomalous use of JSON functions or LIKE expressions with ESCAPE clauses. Additional defensive measures include applying runtime security controls on TaskManager nodes and limiting multi-tenant access until patched versions are deployed. No complete workaround is described beyond upgrading.
Patch, then assume compromise.
Upgrade Apache Flink to a patched release. The advisory states that users should upgrade to 1.20.4, 2.0.2, 2.1.2, or 2.2.1, depending on the deployed branch. These releases fix the unsafe handling of user-controlled strings during SQL code generation.
2 exploits validated by Mallory's analysis.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
10 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.