CVE-2023-25668: TensorFlow: unauthenticated RCE via heap buffer overflow
CRITICAL PoC AVAILABLE CISA: TRACK*Any TensorFlow deployment below 2.12.0 or 2.11.1 with a network-accessible inference endpoint is vulnerable to unauthenticated remote code execution — a worst-case CVSS 9.8 with a public PoC. Patch to TF 2.12.0 or 2.11.1 immediately; if patching is delayed even hours, place model serving behind an authenticating proxy and kill direct internet exposure. Inventory every TF instance across serving infrastructure, notebooks, and training clusters — shadow deployments are the real risk here.
What is the risk?
Extreme. CVSS 9.8 with AV:N/AC:L/PR:N/UI:N represents the most dangerous exploit profile: remotely triggered, trivially repeatable, requiring zero authentication or user interaction. A public exploit commit is referenced in the advisory, reducing the skill bar to near zero. TensorFlow is pervasive across AI/ML stacks — internal serving endpoints, Jupyter environments, and MLOps pipelines are all in scope. Organizations exposing TF Serving directly to the internet are one crafted request away from full server compromise.
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 immediately: upgrade TensorFlow to 2.12.0+ or apply the 2.11.1 cherry-pick (commit 7b174a0f2e40ff3f3aa957aecddfd5aaae35eccb).
-
Inventory: enumerate all TF versions in production serving, training clusters, CI/CD pipelines, and developer notebooks — pay special attention to pinned requirements.txt or conda envs.
-
Network hardening: ensure model serving APIs are behind API gateways with authentication; block direct internet exposure of ports 8500/8501 (TF Serving defaults).
-
Container isolation: run TF serving in sandboxed containers with no outbound network, drop capabilities, and read-only rootfs to constrain RCE blast radius.
-
Detection: alert on unexpected crashes, segmentation faults, or OOM kills in TF serving processes — these are early indicators 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-2023-25668?
Any TensorFlow deployment below 2.12.0 or 2.11.1 with a network-accessible inference endpoint is vulnerable to unauthenticated remote code execution — a worst-case CVSS 9.8 with a public PoC. Patch to TF 2.12.0 or 2.11.1 immediately; if patching is delayed even hours, place model serving behind an authenticating proxy and kill direct internet exposure. Inventory every TF instance across serving infrastructure, notebooks, and training clusters — shadow deployments are the real risk here.
Is CVE-2023-25668 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2023-25668, increasing the risk of exploitation.
How to fix CVE-2023-25668?
1. Patch immediately: upgrade TensorFlow to 2.12.0+ or apply the 2.11.1 cherry-pick (commit 7b174a0f2e40ff3f3aa957aecddfd5aaae35eccb). 2. Inventory: enumerate all TF versions in production serving, training clusters, CI/CD pipelines, and developer notebooks — pay special attention to pinned requirements.txt or conda envs. 3. Network hardening: ensure model serving APIs are behind API gateways with authentication; block direct internet exposure of ports 8500/8501 (TF Serving defaults). 4. Container isolation: run TF serving in sandboxed containers with no outbound network, drop capabilities, and read-only rootfs to constrain RCE blast radius. 5. Detection: alert on unexpected crashes, segmentation faults, or OOM kills in TF serving processes — these are early indicators of exploitation attempts.
What systems are affected by CVE-2023-25668?
This vulnerability affects the following AI/ML architecture patterns: model serving, inference APIs, training pipelines, MLOps platforms, Jupyter/notebook environments.
What is the CVSS score for CVE-2023-25668?
CVE-2023-25668 has a CVSS v3.1 base score of 9.8 (CRITICAL). The EPSS exploitation probability is 0.83%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001 AI Software AML.T0025 Exfiltration via Cyber Means AML.T0035 AI Artifact Collection 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. Attackers using Tensorflow prior to 2.12.0 or 2.11.1 can access heap memory which is not in the control of user, leading to a crash or remote code execution. The fix will be included in TensorFlow version 2.12.0 and will also cherrypick this commit on TensorFlow version 2.11.1.
Exploitation Scenario
Attacker scans for internet-facing TensorFlow Serving endpoints via Shodan (ports 8500/8501, gRPC/REST). Against a vulnerable instance, they send a crafted HTTP prediction request containing a malformed tensor with dimensions or data engineered to trigger the heap buffer overflow in a vulnerable TF operation kernel. On unpatched versions, this corrupts heap memory — either crashing the process (disrupting inference SLAs) or redirecting execution. With RCE, the attacker deploys a reverse shell, exfiltrates model weights and training data from mounted volumes, and queries the cloud metadata endpoint to harvest IAM credentials for lateral movement to S3 buckets, GCS, or Azure Blob containing proprietary data.
Weaknesses (CWE)
CWE-122 — Heap-based Buffer Overflow: A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc().
- Pre-design: Use a language or compiler that performs automatic bounds checking.
- [Architecture and Design] Use an abstraction library to abstract away risky APIs. Not a complete solution.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/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