CVE-2022-21736: TensorFlow: NULL deref DoS via SparseTensorSliceDataset

MEDIUM PoC AVAILABLE CISA: TRACK*
Published February 3, 2022
CISO Take

A low-privilege authenticated user can crash TensorFlow processes by submitting malformed sparse tensor inputs to SparseTensorSliceDataset, causing availability loss in ML serving and training infrastructure. Patch to TF 2.8.0, 2.7.1, 2.6.3, or 2.5.3 immediately. If patching is delayed, enforce strict input validation at API ingestion boundaries and restrict who can submit inference or training jobs.

What is the risk?

Medium risk with elevated exposure in multi-tenant ML environments. CVSS 6.5 reflects a network-accessible DoS requiring only low privileges—no authentication complexity or user interaction needed. Impact is purely availability; no data is exposed or model integrity compromised. Risk escalates in shared ML platforms, SaaS inference endpoints, or CI/CD pipelines where untrusted parties can submit tensor data, as repeated exploitation causes sustained service disruption.

What systems are affected?

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

Do you use TensorFlow? You're affected.

How severe is it?

CVSS 3.1
6.5 / 10
EPSS
0.7%
chance of exploitation in 30 days
Higher than 50% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Moderate
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 Network
AC Low
PR Low
UI None
S Unchanged
C None
I None
A High

What should I do?

5 steps
  1. Upgrade to TensorFlow 2.8.0, 2.7.1, 2.6.3, or 2.5.3 where the fix is cherrypicked.

  2. If immediate patching is blocked, add server-side validation rejecting sparse tensors with mismatched shape/indices/values before they reach tf.data operators.

  3. Run TF Serving with process-level isolation and automatic restart policies to contain blast radius of crashes.

  4. Audit all API surfaces that accept sparse tensor inputs from untrusted or low-privilege callers.

  5. Monitor for unexpected TF process crashes or anomalous sparse tensor request patterns as an indicator of exploitation attempts.

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
Clause 8.4 - AI system operation
NIST AI RMF
GOVERN-1.4 - Organizational teams document the risks and impacts of AI technologies MANAGE-2.4 - Residual risks are monitored and treated on an ongoing basis

Frequently Asked Questions

What is CVE-2022-21736?

A low-privilege authenticated user can crash TensorFlow processes by submitting malformed sparse tensor inputs to SparseTensorSliceDataset, causing availability loss in ML serving and training infrastructure. Patch to TF 2.8.0, 2.7.1, 2.6.3, or 2.5.3 immediately. If patching is delayed, enforce strict input validation at API ingestion boundaries and restrict who can submit inference or training jobs.

Is CVE-2022-21736 actively exploited?

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

How to fix CVE-2022-21736?

1. Upgrade to TensorFlow 2.8.0, 2.7.1, 2.6.3, or 2.5.3 where the fix is cherrypicked. 2. If immediate patching is blocked, add server-side validation rejecting sparse tensors with mismatched shape/indices/values before they reach tf.data operators. 3. Run TF Serving with process-level isolation and automatic restart policies to contain blast radius of crashes. 4. Audit all API surfaces that accept sparse tensor inputs from untrusted or low-privilege callers. 5. Monitor for unexpected TF process crashes or anomalous sparse tensor request patterns as an indicator of exploitation attempts.

What systems are affected by CVE-2022-21736?

This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, data preprocessing, inference.

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

CVE-2022-21736 has a CVSS v3.1 base score of 6.5 (MEDIUM). The EPSS exploitation probability is 0.73%.

What is the AI security impact?

Affected AI Architectures

model servingtraining pipelinesdata preprocessinginference

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: Clause 8.4
NIST AI RMF: GOVERN-1.4, MANAGE-2.4

What are the technical details?

Original Advisory

Tensorflow is an Open Source Machine Learning Framework. The implementation of `SparseTensorSliceDataset` has an undefined behavior: under certain condition it can be made to dereference a `nullptr` value. The 3 input arguments to `SparseTensorSliceDataset` represent a sparse tensor. However, there are some preconditions that these arguments must satisfy but these are not validated in the implementation. The fix will be included in TensorFlow 2.8.0. We will also cherrypick this commit on TensorFlow 2.7.1, TensorFlow 2.6.3, and TensorFlow 2.5.3, as these are also affected and still in supported range.

Exploitation Scenario

An adversary with a low-privilege API account on a TensorFlow Serving endpoint—or job submission rights on a shared ML training cluster—crafts a sparse tensor with missing, null, or mismatched shape/indices/values arguments. They submit this as inference input or as part of a tf.data pipeline that internally invokes SparseTensorSliceDataset. The absent input validation triggers a null pointer dereference, immediately crashing the TF process. By automating repeated submissions, the adversary sustains a DoS against the inference endpoint, disrupting downstream applications that depend on real-time model scoring.

Weaknesses (CWE)

CWE-476 — NULL Pointer Dereference: The product dereferences a pointer that it expects to be valid but is NULL.

  • [Implementation] For any pointers that could have been modified or provided from a function that can return NULL, check the pointer for NULL before use. When working with a multithreaded or otherwise asynchronous environment, ensure that proper locking APIs are used to lock before the check, and unlock when it has finished [REF-1484].
  • [Requirements] Select a programming language that is not susceptible to these issues.

Source: MITRE CWE corpus.

CVSS Vector

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

Timeline

Published
February 3, 2022
Last Modified
May 5, 2025
First Seen
February 3, 2022

Related Vulnerabilities