HIGH 8.1

CVE-2026-35194

Apache Flink: Remote code execution via SQL injection in code generation

Description

Code injection in SQL code generation in Apache Flink 1.15.0 through 1.20.x and 2.0.0 through 2.x allows authenticated users with query submission privileges to execute arbitrary code on TaskManagers via maliciously crafted SQL queries. The vulnerability affects JSON functions (1.15.0+) and LIKE expressions with ESCAPE clauses (1.17.0+). User-controlled strings are interpolated into generated Java code without proper escaping, allowing attackers to break out of string literals and inject arbitrary expressions.

Users are recommended to upgrade to either version 1.20.4, 2.0.2, 2.1.2 or 2.2.1, which fixes this issue.

Affected Maven artifacts (3)

ArtifactAffected versionsFixed in
org.apache.flink » flink-table-api-java
>= 1.15.0, < 1.20.4>= 2.0.0, < 2.0.2>= 2.1.0, < 2.1.2>= 2.2.0, < 2.2.1
1.20.4, 2.0.2, 2.1.2, 2.2.1
org.apache.flink » flink-table-planner_2.12
>= 1.15.0, < 1.20.4>= 2.0.0, < 2.0.2>= 2.1.0, < 2.1.2>= 2.2.0, < 2.2.1
1.20.4, 2.0.2, 2.1.2, 2.2.1
org.apache.flink » flink-table-runtime
>= 1.15.0, < 1.20.4>= 2.0.0, < 2.0.2>= 2.1.0, < 2.1.2>= 2.2.0, < 2.2.1
1.20.4, 2.0.2, 2.1.2, 2.2.1

Blast radius

3affected artifacts
342affected versions
112dependent artifacts (est.)
3,609dependent versions

100% of the dependent artifacts (112) still pull an affected version in their latest release.

DepthDependent versions
Direct
1,652
2 hops
1,521
3 hops
382
4 hops
46
5 hops
8

Most used dependents

Computed from the dependency graph of build 20261201.0702 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.

References

Advisorynvd.nist.gov
Packagegithub.com
Webgithub.com
Webgithub.com
Weblists.apache.org
Webopenwall.com