CVE-2023-25665: TensorFlow: null ptr deref DoS via sparse tensors
HIGH PoC AVAILABLE CISA: TRACK*Any TensorFlow deployment exposing model endpoints that accept sparse tensor inputs is vulnerable to unauthenticated remote crash — effectively a DoS with zero prerequisites. Patch to TF 2.12.0 or 2.11.1 immediately; if patching is delayed, restrict network access to inference endpoints and validate tensor inputs at the API gateway layer. Not actively exploited in the wild, but trivial to trigger.
What is the risk?
High severity (CVSS 7.5) with network-accessible, zero-interaction, zero-privilege attack vector makes this readily exploitable against exposed TensorFlow serving endpoints. Impact is limited to availability — no data exfiltration or code execution path. Real-world risk depends heavily on exposure: internal-only training clusters face minimal risk, while public-facing ML inference APIs are directly in scope. Not in CISA KEV and no public PoC exploitation reported, reducing urgency marginally.
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-
PATCH
Upgrade to TensorFlow 2.12.0 or 2.11.1 — the only complete fix.
-
WORKAROUND
Add input validation before SparseSparseMaximum calls to verify tensor indices/values are non-null and within valid ranges.
-
NETWORK CONTROLS
Restrict inference API access to authenticated, authorized clients only; use API gateway rate-limiting to reduce DoS blast radius.
-
DETECTION
Monitor for repeated process crashes or pod restarts in ML serving infrastructure; alert on abnormal TensorFlow exception rates.
-
AUDIT
Identify all internal services consuming TF versions < 2.11.1 via dependency scanning (pip list, requirements.txt audit).
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-2023-25665?
Any TensorFlow deployment exposing model endpoints that accept sparse tensor inputs is vulnerable to unauthenticated remote crash — effectively a DoS with zero prerequisites. Patch to TF 2.12.0 or 2.11.1 immediately; if patching is delayed, restrict network access to inference endpoints and validate tensor inputs at the API gateway layer. Not actively exploited in the wild, but trivial to trigger.
Is CVE-2023-25665 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2023-25665, increasing the risk of exploitation.
How to fix CVE-2023-25665?
1. PATCH: Upgrade to TensorFlow 2.12.0 or 2.11.1 — the only complete fix. 2. WORKAROUND: Add input validation before SparseSparseMaximum calls to verify tensor indices/values are non-null and within valid ranges. 3. NETWORK CONTROLS: Restrict inference API access to authenticated, authorized clients only; use API gateway rate-limiting to reduce DoS blast radius. 4. DETECTION: Monitor for repeated process crashes or pod restarts in ML serving infrastructure; alert on abnormal TensorFlow exception rates. 5. AUDIT: Identify all internal services consuming TF versions < 2.11.1 via dependency scanning (pip list, requirements.txt audit).
What systems are affected by CVE-2023-25665?
This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, ML API endpoints.
What is the CVSS score for CVE-2023-25665?
CVE-2023-25665 has a CVSS v3.1 base score of 7.5 (HIGH). The EPSS exploitation probability is 0.45%.
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 platform for machine learning. Prior to versions 2.12.0 and 2.11.1, when `SparseSparseMaximum` is given invalid sparse tensors as inputs, it can give a null pointer error. A fix is included in TensorFlow version 2.12 and version 2.11.1.
Exploitation Scenario
An adversary identifies a public-facing TensorFlow Serving endpoint (e.g., via Shodan for port 8501/8500, or through API documentation leakage). They craft a POST request to the predict API containing an intentionally malformed SparseSparseMaximum input — a sparse tensor with null or zero-length index arrays. TensorFlow dereferences the null pointer inside the kernel, triggering a segfault that crashes the serving process. In Kubernetes deployments, the crash loop can be sustained by repeating the request faster than the restart policy recovers, achieving sustained service disruption against ML-dependent applications such as fraud detection, content moderation, or recommendation engines.
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:N/UI:N/S:U/C:N/I:N/A:H References
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