CVE-2022-41908: TensorFlow: DoS via invalid UTF-8 input to PyFunc op

HIGH PoC AVAILABLE CISA: TRACK*
Published November 18, 2022
CISO Take

Any TensorFlow serving infrastructure exposing models that accept string inputs via PyFunc is vulnerable to a trivial, unauthenticated crash. An attacker sending a single malformed UTF-8 byte sequence takes down the serving process — no authentication, no complexity. Patch to TF 2.11, 2.10.1, 2.9.3, or 2.8.4 immediately; add UTF-8 input validation at the API gateway as a defense-in-depth layer.

What is the risk?

High (CVSS 7.5). Network-reachable with no privileges or user interaction required makes this trivially weaponizable against public-facing model serving endpoints. The blast radius is limited to availability — no data exfiltration or code execution — but a single malformed request can crash the TF process. Risk is elevated in multi-tenant inference platforms where a single tenant crash could cascade to shared infrastructure.

What systems are affected?

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

Do you use TensorFlow? You're affected.

How severe is it?

CVSS 3.1
7.5 / 10
EPSS
0.4%
chance of exploitation in 30 days
Higher than 36% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Trivial
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 None
UI None
S Unchanged
C None
I None
A High

What should I do?

5 steps
  1. Patch: Upgrade to TensorFlow 2.11, 2.10.1, 2.9.3, or 2.8.4.

  2. Workaround: Validate all string inputs are valid UTF-8 before invoking PyFunc — use Python's str.encode('utf-8') with error handling or a gateway-level sanitizer.

  3. API gateway: Add input schema validation rejecting invalid byte sequences before they reach the TF runtime.

  4. Detection: Monitor for sudden TF process restarts/crashes correlated with unusual input patterns in serving logs.

  5. Container isolation: Ensure TF serving runs in isolated containers so a crash does not affect other services.

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
8.4 - AI System Operation and Monitoring
NIST AI RMF
MANAGE-2.4 - Residual risks and errors are monitored and managed
OWASP LLM Top 10
LLM04 - Model Denial of Service

Frequently Asked Questions

What is CVE-2022-41908?

Any TensorFlow serving infrastructure exposing models that accept string inputs via PyFunc is vulnerable to a trivial, unauthenticated crash. An attacker sending a single malformed UTF-8 byte sequence takes down the serving process — no authentication, no complexity. Patch to TF 2.11, 2.10.1, 2.9.3, or 2.8.4 immediately; add UTF-8 input validation at the API gateway as a defense-in-depth layer.

Is CVE-2022-41908 actively exploited?

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

How to fix CVE-2022-41908?

1. Patch: Upgrade to TensorFlow 2.11, 2.10.1, 2.9.3, or 2.8.4. 2. Workaround: Validate all string inputs are valid UTF-8 before invoking PyFunc — use Python's str.encode('utf-8') with error handling or a gateway-level sanitizer. 3. API gateway: Add input schema validation rejecting invalid byte sequences before they reach the TF runtime. 4. Detection: Monitor for sudden TF process restarts/crashes correlated with unusual input patterns in serving logs. 5. Container isolation: Ensure TF serving runs in isolated containers so a crash does not affect other services.

What systems are affected by CVE-2022-41908?

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

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

CVE-2022-41908 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

model servingtraining pipelinesinference APIs

MITRE ATLAS Techniques

AML.T0029 Denial of AI Service
AML.T0034 Cost Harvesting
AML.T0049 Exploit Public-Facing Application

Compliance Controls Affected

EU AI Act: Article 15
ISO 42001: 8.4
NIST AI RMF: MANAGE-2.4
OWASP LLM Top 10: LLM04

What are the technical details?

Original Advisory

TensorFlow is an open source platform for machine learning. An input `token` that is not a UTF-8 bytestring will trigger a `CHECK` fail in `tf.raw_ops.PyFunc`. We have patched the issue in GitHub commit 9f03a9d3bafe902c1e6beb105b2f24172f238645. The fix will be included in TensorFlow 2.11. We will also cherrypick this commit on TensorFlow 2.10.1, 2.9.3, and TensorFlow 2.8.4, as these are also affected and still in supported range.

Exploitation Scenario

An adversary identifies an internet-facing model inference API backed by TensorFlow. They send a POST request with a token field containing a byte sequence that is not valid UTF-8 (e.g., a raw 0xFF byte). TensorFlow's PyFunc performs a CHECK assertion on the token's encoding — the assertion fails, triggering an immediate process abort via SIGABRT. The serving container crashes, returning 503 to legitimate users. An attacker can automate this in a loop to maintain a sustained denial-of-service against the inference endpoint with minimal resources, no credentials, and without triggering typical rate-limit defenses since each request is a single packet.

Weaknesses (CWE)

CWE-20 — Improper Input Validation: The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.

  • [Architecture and Design] Consider using language-theoretic security (LangSec) techniques that characterize inputs using a formal language and build "recognizers" for that language. This effectively requires parsing to be a distinct layer that effectively enforces a boundary between raw input and internal data representations, instead of allowing parser code to be scattered throughout the program, where it could be subject to errors or inconsistencies that create weaknesses. [REF-1109] [REF-1110] [REF-1111]
  • [Architecture and Design] Use an input validation framework such as Struts or the OWASP ESAPI Validation API. Note that using a framework does not automatically address all input validation problems; be mindful of weaknesses that could arise from misusing the framework itself (CWE-1173).

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

Timeline

Published
November 18, 2022
Last Modified
November 21, 2024
First Seen
November 18, 2022

Related Vulnerabilities