CVE-2022-29208: TensorFlow: OOB write in EditDistance enables local DoS

HIGH PoC AVAILABLE CISA: TRACK*
Published May 20, 2022
CISO Take

A low-privileged local attacker can crash TensorFlow processes by passing negative index values to tf.raw_ops.EditDistance, exploiting missing lower-bound array validation (CWE-787 Out-of-Bounds Write). Upgrade to TF 2.9.0, 2.8.1, 2.7.2, or 2.6.4 immediately. Risk is highest in shared ML platforms where users can submit arbitrary TF operations against shared training or inference infrastructure.

What is the risk?

CVSS 7.1 (High) with local attack vector limits remote exploitation. However, the low privilege requirement and low complexity make this trivially exploitable by any user with TF execution access. In shared ML environments—JupyterHub, managed training platforms, model serving clusters—this enables a disruptive DoS against training jobs and inference servers. The CWE-787 OOB write also carries theoretical code execution potential beyond DoS, though practical exploitation beyond crash has not been confirmed. Not in CISA KEV; no evidence of active in-the-wild exploitation.

What systems are affected?

Package Ecosystem Vulnerable Range Patched
TensorFlow pip No patch
195.8K OpenSSF 7.1 3.7K dependents Pushed 3d ago 4% patched ~1372d to patch Full package profile →

Do you use TensorFlow? You're affected.

How severe is it?

CVSS 3.1
7.1 / 10
EPSS
0.4%
chance of exploitation in 30 days
Higher than 29% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Trivial
Exploitation Confidence
medium
CISA SSVC: Public PoC
Public PoC indexed (trickest/cve)
Composite signal derived from CISA KEV, VulnCheck KEV, CISA SSVC, EPSS, Metasploit, Exploit-DB, trickest/cve, Nuclei templates, and inthewild.io exploitation reports.

What is the attack surface?

AV AC PR UI S C I A
AV Local
AC Low
PR Low
UI None
S Unchanged
C None
I High
A High

What should I do?

5 steps
  1. Patch: Upgrade TensorFlow to 2.9.0, 2.8.1, 2.7.2, or 2.6.4 per your current major version track.

  2. Audit: Inventory all production and development TF versions with pip show tensorflow | grep Version.

  3. Workaround: Add pre-execution validation to reject negative index values before invoking EditDistance ops; wrap calls in input sanitization layers.

  4. Restrict: Limit user permissions to submit raw TF ops in shared JupyterHub or training platforms.

  5. Detect: Monitor for unexpected SIGSEGV signals or abrupt process exits in TF serving and training job logs.

What does CISA's SSVC say?

Decision Track*
Exploitation poc
Automatable No
Technical Impact partial

Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.

How is it classified?

Which compliance frameworks are affected?

This CVE is relevant to:

EU AI Act
Article 15 - Accuracy, robustness and cybersecurity
ISO 42001
A.6.2.6 - AI system security testing
NIST AI RMF
MANAGE 2.2 - Mechanisms to sustain oversight of deployed AI
OWASP LLM Top 10
LLM05:2025 - Supply Chain Vulnerabilities

Frequently Asked Questions

What is CVE-2022-29208?

A low-privileged local attacker can crash TensorFlow processes by passing negative index values to tf.raw_ops.EditDistance, exploiting missing lower-bound array validation (CWE-787 Out-of-Bounds Write). Upgrade to TF 2.9.0, 2.8.1, 2.7.2, or 2.6.4 immediately. Risk is highest in shared ML platforms where users can submit arbitrary TF operations against shared training or inference infrastructure.

Is CVE-2022-29208 actively exploited?

Proof-of-concept exploit code is publicly available for CVE-2022-29208, increasing the risk of exploitation.

How to fix CVE-2022-29208?

1. Patch: Upgrade TensorFlow to 2.9.0, 2.8.1, 2.7.2, or 2.6.4 per your current major version track. 2. Audit: Inventory all production and development TF versions with `pip show tensorflow | grep Version`. 3. Workaround: Add pre-execution validation to reject negative index values before invoking EditDistance ops; wrap calls in input sanitization layers. 4. Restrict: Limit user permissions to submit raw TF ops in shared JupyterHub or training platforms. 5. Detect: Monitor for unexpected SIGSEGV signals or abrupt process exits in TF serving and training job logs.

What systems are affected by CVE-2022-29208?

This vulnerability affects the following AI/ML architecture patterns: training pipelines, model serving, ML development environments, shared ML platforms.

What is the CVSS score for CVE-2022-29208?

CVE-2022-29208 has a CVSS v3.1 base score of 7.1 (HIGH). The EPSS exploitation probability is 0.38%.

What is the AI security impact?

Affected AI Architectures

training pipelinesmodel servingML development environmentsshared ML platforms

MITRE ATLAS Techniques

AML.T0010.001 AI Software
AML.T0029 Denial of AI Service
AML.T0049 Exploit Public-Facing Application

Compliance Controls Affected

EU AI Act: Article 15
ISO 42001: A.6.2.6
NIST AI RMF: MANAGE 2.2
OWASP LLM Top 10: LLM05:2025

What are the technical details?

Original Advisory

TensorFlow is an open source platform for machine learning. Prior to versions 2.9.0, 2.8.1, 2.7.2, and 2.6.4, the implementation of `tf.raw_ops.EditDistance` has incomplete validation. Users can pass negative values to cause a segmentation fault based denial of service. In multiple places throughout the code, one may compute an index for a write operation. However, the existing validation only checks against the upper bound of the array. Hence, it is possible to write before the array by massaging the input to generate negative values for `loc`. Versions 2.9.0, 2.8.1, 2.7.2, and 2.6.4 contain a patch for this issue.

Exploitation Scenario

An attacker with low-privilege access to a shared ML training platform or JupyterHub instance crafts a TF computation graph invoking tf.raw_ops.EditDistance with carefully chosen negative values for the `loc` index parameter. When the graph is executed, the missing lower-bound check causes an out-of-bounds write that triggers a segfault, immediately terminating the TF process. On a shared training cluster, this aborts long-running distributed training jobs and corrupts in-progress checkpoints. If TF Serving is deployed with an EditDistance-based model and accepts external tensor inputs, an unauthenticated remote attacker could chain this to crash the serving process, causing service outage.

Weaknesses (CWE)

CWE-787 — Out-of-bounds Write: The product writes data past the end, or before the beginning, of the intended buffer.

  • [Requirements] Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, many languages that perform their own memory management, such as Java and Perl, are not subject to buffer overflows. Other languages, such as Ada and C#, typically provide overflow protection, but the protection can be disabled by the programmer. Be wary that a language's interface to native code may still be subject to overflows, even if the language itself is theoretically safe.
  • [Architecture and Design] Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. Examples include the Safe C String Library (SafeStr) by Messier and Viega [REF-57], and the Strsafe.h library from Microsoft [REF-56]. These libraries provide safer versions of overflow-prone string-handling functions.

Source: MITRE CWE corpus.

CVSS Vector

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H

Timeline

Published
May 20, 2022
Last Modified
November 21, 2024
First Seen
May 20, 2022

Related Vulnerabilities