CVE-2022-21736: TensorFlow: NULL deref DoS via SparseTensorSliceDataset
MEDIUM PoC AVAILABLE CISA: TRACK*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 |
Do you use TensorFlow? You're affected.
How severe is it?
What is the attack surface?
What should I do?
5 steps-
Upgrade to TensorFlow 2.8.0, 2.7.1, 2.6.3, or 2.5.3 where the fix is cherrypicked.
-
If immediate patching is blocked, add server-side validation rejecting sparse tensors with mismatched shape/indices/values before they reach tf.data operators.
-
Run TF Serving with process-level isolation and automatic restart policies to contain blast radius of crashes.
-
Audit all API surfaces that accept sparse tensor inputs from untrusted or low-privilege callers.
-
Monitor for unexpected TF process crashes or anomalous sparse tensor request patterns as an indicator of exploitation attempts.
What does CISA's SSVC say?
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:
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
MITRE ATLAS Techniques
AML.T0010.001 AI Software AML.T0029 Denial of AI Service AML.T0049 Exploit Public-Facing Application Compliance Controls Affected
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 References
- github.com/tensorflow/tensorflow/blob/5100e359aef5c8021f2e71c7b986420b85ce7b3d/tensorflow/core/kernels/data/sparse_tensor_slice_dataset_op.cc Exploit 3rd Party
- github.com/tensorflow/tensorflow/commit/965b97e4a9650495cda5a8c210ef6684b4b9eceb Patch 3rd Party
- github.com/tensorflow/tensorflow/security/advisories/GHSA-pfjj-m3jj-9jc9 Patch 3rd Party
- github.com/ARPSyndicate/cvemon Exploit
Timeline
Related Vulnerabilities
CVE-2020-15196 9.9 TensorFlow: heap OOB read in sparse/ragged count ops
Same package: tensorflow CVE-2020-15205 9.8 TensorFlow: heap overflow in StringNGrams, ASLR bypass
Same package: tensorflow CVE-2020-15208 9.8 TFLite: OOB read/write via tensor dimension mismatch
Same package: tensorflow CVE-2019-16778 9.8 TensorFlow: heap overflow in UnsortedSegmentSum op
Same package: tensorflow CVE-2022-23587 9.8 TensorFlow: integer overflow in Grappler enables RCE
Same package: tensorflow