# CVE-2026-35194: Apache Flink: Remote code execution via SQL injection in code generation

> Authenticated users can execute arbitrary code on TaskManagers by injecting malicious expressions into generated Java code via crafted SQL queries.

- **Severity:** High 8.1 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 15 May 2026
- **Updated:** 15 May 2026
- **Also known as:** BIT-flink-2026-35194, ECHO-fb26-ef43-981b, GHSA-2f54-v4hm-fx73, MINI-35w8-758x-rg8w, MINI-8pgq-2h5r-838m, MINI-gp88-p5fc-h9f3, MINI-pfrh-wrhx-c6g7

## What is CVE-2026-35194?

CVE-2026-35194 is a high-severity code injection vulnerability in Apache Flink, published on 15 May 2026. Any signed-in user can exploit it over the network, with no action from the victim.

### Official 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.

Weakness: CWE-94 (Improper Control of Generation of Code)

## Which versions are affected by CVE-2026-35194?

25 open source packages ship an affected version, including org.apache.flink:flink-table-api-java, flink and org.apache.flink:flink-table-planner_2.12. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.apache.flink:flink-table-api-java` | Maven | From 1.15.0 | 1.20.4 |
| `org.apache.flink:flink-table-api-java` | Maven | From 1.15.0 | 1.20.4 |
| `org.apache.flink:flink-table-api-java` | Maven | From 2.0.0 | 2.0.2 |
| `org.apache.flink:flink-table-api-java` | Maven | From 2.0.0 | 2.0.2 |
| `org.apache.flink:flink-table-api-java` | Maven | From 2.1.0 | 2.1.2 |
| `org.apache.flink:flink-table-api-java` | Maven | From 2.1.0 | 2.1.2 |
| `org.apache.flink:flink-table-api-java` | Maven | From 2.2.0 | 2.2.1 |
| `org.apache.flink:flink-table-api-java` | Maven | From 2.2.0 | 2.2.1 |
| `flink` | Bitnami | From 1.15.0 | 1.20.4, 2.0.2, 2.1.1, 2.2.1 |
| `org.apache.flink:flink-table-planner_2.12` | Maven | From 1.15.0 | 1.20.4 |
| `org.apache.flink:flink-table-planner_2.12` | Maven | From 1.15.0 | 1.20.4 |
| `org.apache.flink:flink-table-planner_2.12` | Maven | From 2.0.0 | 2.0.2 |
| `org.apache.flink:flink-table-planner_2.12` | Maven | From 2.0.0 | 2.0.2 |
| `org.apache.flink:flink-table-planner_2.12` | Maven | From 2.1.0 | 2.1.2 |
| `org.apache.flink:flink-table-planner_2.12` | Maven | From 2.1.0 | 2.1.2 |
| `org.apache.flink:flink-table-planner_2.12` | Maven | From 2.2.0 | 2.2.1 |
| `org.apache.flink:flink-table-planner_2.12` | Maven | From 2.2.0 | 2.2.1 |
| `org.apache.flink:flink-table-runtime` | Maven | From 1.15.0 | 1.20.4 |
| `org.apache.flink:flink-table-runtime` | Maven | From 1.15.0 | 1.20.4 |
| `org.apache.flink:flink-table-runtime` | Maven | From 2.0.0 | 2.0.2 |
| `org.apache.flink:flink-table-runtime` | Maven | From 2.0.0 | 2.0.2 |
| `org.apache.flink:flink-table-runtime` | Maven | From 2.1.0 | 2.1.2 |
| `org.apache.flink:flink-table-runtime` | Maven | From 2.1.0 | 2.1.2 |
| `org.apache.flink:flink-table-runtime` | Maven | From 2.2.0 | 2.2.1 |
| `org.apache.flink:flink-table-runtime` | Maven | From 2.2.0 | 2.2.1 |

Products: Apache Flink.

## How do I fix CVE-2026-35194?

Upgrade org.apache.flink:flink-table-api-java to a fixed version for your release line: 1.20.4, 2.0.2, 2.1.2 or 2.2.1.

## Is CVE-2026-35194 being exploited?

There is no known exploitation of CVE-2026-35194 in the wild and no public exploit code.

Public exploit code:

- Proof-of-concept exploit and lab environment for CVE-2026-35194 (github_poc): https://github.com/DexSemon/CVE-2026-35194

## Other vulnerabilities in Apache Flink

- [CVE-2020-17519](https://insights.sbomify.com/CVE-2020-17519/): Apache Flink Improper Access Control (critical 9.1, exploited in the wild)
- [CVE-2020-17518](https://insights.sbomify.com/CVE-2020-17518/): Apache Flink directory traversal attack: remote file writing through the REST API (high 7.5)
- [CVE-2020-1960](https://insights.sbomify.com/CVE-2020-1960/): Command injection in Apache Flink (medium 4.7)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-35194 and fix it if it is affected.

What it is: CVE-2026-35194 is a high-severity code injection vulnerability in Apache Flink, published on 15 May 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-35194 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.apache.flink:flink-table-api-java (Maven): affected from 1.15.0; fixed in 1.20.4
- org.apache.flink:flink-table-api-java (Maven): affected from 1.15.0; fixed in 1.20.4
- org.apache.flink:flink-table-api-java (Maven): affected from 2.0.0; fixed in 2.0.2
- org.apache.flink:flink-table-api-java (Maven): affected from 2.0.0; fixed in 2.0.2
- org.apache.flink:flink-table-api-java (Maven): affected from 2.1.0; fixed in 2.1.2
- org.apache.flink:flink-table-api-java (Maven): affected from 2.1.0; fixed in 2.1.2
- org.apache.flink:flink-table-api-java (Maven): affected from 2.2.0; fixed in 2.2.1
- org.apache.flink:flink-table-api-java (Maven): affected from 2.2.0; fixed in 2.2.1
- flink (Bitnami): affected from 1.15.0; fixed in 1.20.4, 2.0.2, 2.1.1, 2.2.1
- org.apache.flink:flink-table-planner_2.12 (Maven): affected from 1.15.0; fixed in 1.20.4
- org.apache.flink:flink-table-planner_2.12 (Maven): affected from 1.15.0; fixed in 1.20.4
- org.apache.flink:flink-table-planner_2.12 (Maven): affected from 2.0.0; fixed in 2.0.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-35194/ (Markdown: https://insights.sbomify.com/CVE-2026-35194/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-35194
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-35194
- OSV: https://osv.dev/vulnerability/CVE-2026-35194

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-35194/
Summaries are generated and may contain mistakes; the official description above is the record.
