Skip to content
Heist/ feed
Back to feed
High

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

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-35194
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 19:48 UTC · Revision 1

Source evidence

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

core-osv · Original source

Published 15 May 2026, 15:27 UTC

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.

osv:CVE-2026-35194
Complete source record
{
  "id": "24c30e95cb33f71628ebd83986acbc0fee5447590e5c4d2cf427e78fe9c1134e",
  "url": "https://osv.dev/vulnerability/CVE-2026-35194",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Apache Flink: Remote code execution via SQL injection in code generation",
    "summary": "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.",
    "evidence": "osv:CVE-2026-35194",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2026-35194",
      "aliases": [
        "BIT-flink-2026-35194",
        "CVE-2026-35194",
        "GHSA-2f54-v4hm-fx73"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/apache/flink",
              "type": "GIT",
              "events": [
                {
                  "introduced": "5a336892424a9458653ead89610bf60d771ab8d7"
                },
                {
                  "last_affected": "fdea141397bffb37223176067070411d67803fa1"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:apache:flink:2.2.0:-:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "2.2.0-NA"
                      },
                      {
                        "last_affected": "2.2.0-NA"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:apache:flink:2.2.0:rc2:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "2.2.0-rc2"
                      },
                      {
                        "last_affected": "2.2.0-rc2"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "cpe": "cpe:2.3:a:apache:flink:2.2.0:rc1:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "2.2.0-rc1"
                      },
                      {
                        "last_affected": "2.2.0-rc1"
                      }
                    ],
                    "source": "CPE_STRING"
                  }
                ]
              }
            }
          ],
          "versions": [
            "2.2.0-NA",
            "2.2.0-rc1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-35194.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:31.892178884Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/35xxx/CVE-2026-35194.json",
        "https://lists.apache.org/thread/qh52bw4hhvy7n2owd8b3bt51mz0lvj9x",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-35194"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-94"
        ],
        "cna_assigner": "apache",
        "unresolved_ranges": [
          {
            "extracted_events": [
              {
                "range": [
                  {
                    "introduced": "1.15.0"
                  },
                  {
                    "fixed": "1.20.4,2.0.2,2.1.2,2.2.1"
                  }
                ],
                "source": "AFFECTED_FIELD",
                "strategy": "StandardRange"
              }
            ]
          }
        ],
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/35xxx/CVE-2026-35194.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-35194",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 498806,
  "published_at": "2026-05-15T15:27:27.346+00:00"
}