Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐍
🐍 PyPI
Not in CISA KEV
MEDIUM severity

CVE-2022-21732 — tensorflow

MEDIUMFix: tensorflow/tensorflow@e3749a6

CVE-2022-21732 is a medium-severity (CVSS 4.3) CWE-770 vulnerability in tensorflow. 1 public exploit reference exists, so weaponization risk is real. A fix is available for tensorflow — see the affected versions and patch details below.

Memory exhaustion in Tensorflow

Also known asBIT-tensorflow-2022-21732GHSA-c582-c96p-r5cqPYSEC-2022-111PYSEC-2022-56PYSEC-2026-3158
Published
Updated
Affected
9 pkgs
Patched
9 / 9
Exploits
1 known
Exploitation data as of Sep 29, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

No confirmed exploitation observed yet

  • CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.

Exploitation and automatability from CISA’s SSVC triage for CVE-2022-21732.

EPSS Exploitation Probability

via FIRST.org ↗
0.8%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs54th percentile — riskier than 54% of all scored CVEsHighest risk

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

CVE-2022-21732 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.

Where this sits among everything scored

Of 385,386 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.

Real-World Exposure

9 pkgs affected
🐍tensorflow🐍tensorflow🐍tensorflow🐍tensorflow-cpu🐍tensorflow-cpu🐍tensorflow-cpu🐍tensorflow-gpu🐍tensorflow-gpu+1 more

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.

Description

Impact

The implementation of ThreadPoolHandle can be used to trigger a denial of service attack by allocating too much memory:

import tensorflow as tf
y = tf.raw_ops.ThreadPoolHandle(num_threads=0x60000000,display_name='tf')

This is because the num_threads argument is only checked to not be negative, but there is no upper bound on its value.

Patches

We have patched the issue in GitHub commit e3749a6d5d1e8d11806d4a2e9cc3123d1a90b75e.

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.

For more information

Please consult our security guide for more information regarding the security model and how to contact us with issues and questions.

Attribution

This vulnerability has been reported by Yu Tian of Qihoo 360 AIVul Team.

Affected Packages

9 total 9 fixed
EcosystemPackageVulnerable rangeFix
🐍PyPItensorflowall versions2.5.3pip install --upgrade 'tensorflow==2.5.3'
🐍PyPItensorflow≥ 2.6.0&&< 2.6.32.6.3pip install --upgrade 'tensorflow==2.6.3'
🐍PyPItensorflow≥ 2.7.0&&< 2.7.12.7.1pip install --upgrade 'tensorflow==2.7.1'
🐍PyPItensorflow-cpuall versions2.5.3pip install --upgrade 'tensorflow-cpu==2.5.3'
🐍PyPItensorflow-cpu≥ 2.6.0&&< 2.6.32.6.3pip install --upgrade 'tensorflow-cpu==2.6.3'
🐍PyPItensorflow-cpu≥ 2.7.0&&< 2.7.12.7.1pip install --upgrade 'tensorflow-cpu==2.7.1'

Affected Products

1 product · 3 configurations
Application
tensorflowgoogle
≥ 2.6.0 && ≤ 2.6.2
1 version
2.7.0
Exploits & PoCs
1

Research use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for tensorflow, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update tensorflow to 2.5.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2022-21732 is resolved across your whole dependency graph.

  3. Workarounds

    Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.

Frequently Asked Questions

### Impact The [implementation of `ThreadPoolHandle`](https://github.com/tensorflow/tensorflow/blob/5100e359aef5c8021f2e71c7b986420b85ce7b3d/tensorflow/core/kernels/data/experimental/threadpool_dataset_op.cc#L79-L135) can be used to trigger a denial of service attack by allocating too much memory: ```python import tensorflow as tf y = tf.raw_ops.ThreadPoolHandle(num_threads=0x60000000,display_name='tf') ``` This is because the `num_threads` argument is only checked to not be negative, but there is no upper bound on its value. ### Patches We have patched the issue in GitHub commit [e374
O3 Security · Impact-Aware SCA

Is CVE-2022-21732 in your dependencies?

Find it across PyPI, including transitive dependencies.

CVE-2022-21732: tensorflow DoS — Fixed in 2.5.3