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.

Risk Assessment

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.

Affected Systems

Package Ecosystem Vulnerable Range Patched
tensorflow pip No patch
195.0K OpenSSF 7.2 3.7K dependents Pushed 6d ago 4% patched ~1372d to patch Full package profile →

Do you use tensorflow? You're affected.

Severity & Risk

CVSS 3.1
6.5 / 10
EPSS
0.3%
chance of exploitation in 30 days
Higher than 56% 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, CISA SSVC, EPSS, trickest/cve, and Nuclei templates.

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

Recommended Action

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.

CISA SSVC Assessment

Decision Track*
Exploitation poc
Automatable No
Technical Impact partial

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

Classification

Compliance Impact

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.33%.

Technical Details

NVD Description

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.

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