CVE-2021-29614: TensorFlow - Incorrect Results and Python Interpreter Crash in tf.io.decode_raw

tensorflow Updated 02 Oct 2025

Summary

06/03/2024
Yes i
High
Not published

CVE-2021-29614: Interpreter crash from tf.io.decode_raw. Affects tensorflow across 4 version ranges.

< 2.1.4 >= 2.2.0, < 2.2.3 >= 2.3.0, < 2.3.3 >= 2.4.0, < 2.4.2

Fixed in 4 releases; the minimum fixed version depends on the release line you run. How to fix ↓

Also tracked for

The same CVE-2021-29614 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

TensorFlow is an end-to-end open source platform for machine learning. It provides a comprehensive ecosystem for building and deploying machine learning models. The vulnerability identified as CVE-2021-29614 affects the implementation of tf.io.decode_raw in TensorFlow. This function is responsible for decoding raw binary data. The vulnerability arises when combining fixed_length and wider datatypes, leading to incorrect results and crashes in the Python interpreter.

Vulnerability Detail

The vulnerability in TensorFlow's tf.io.decode_raw function is caused by a bug in the implementation of the padded version. The code confuses pointer arithmetic rules, resulting in incorrect decoding and potential out-of-bounds writes. When fixed_length is used to determine the width of each output element, the code mistakenly moves the out_data pointer by fixed_length * sizeof(T) bytes, even though it only copied at most fixed_length bytes from the input. This leads to parts of the input not being decoded into the output and writing outside the bounds of the backing data. While the provided reproducer causes a crash in the Python interpreter, more severe attacks can be mounted by exploiting this vulnerability.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 2.1.4 2.1.4
  • >= 2.2.0, < 2.2.3 2.2.3
  • >= 2.3.0, < 2.3.3 2.3.3
  • >= 2.4.0, < 2.4.2 2.4.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

No workaround has been provided for this vulnerability.

Conclusion

The vulnerability in TensorFlow's tf.io.decode_raw function can lead to incorrect results, crashes in the Python interpreter, and potential out-of-bounds writes. It is crucial to update to the fixed versions of TensorFlow as soon as they are released. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for tensorflow →

Share this vulnerability

FAQ

TensorFlow is an open source platform for machine learning that provides a comprehensive ecosystem for building and deploying machine learning models.

The vulnerability can result in incorrect decoding of raw binary data and crashes in the Python interpreter. It also allows for potential out-of-bounds writes, which can be exploited for more severe attacks.

The vulnerability affects TensorFlow versions 2.1.4, 2.2.3, 2.3.3, and 2.4.2. These versions are within the supported range and will receive the fix.

No workaround has been provided for this vulnerability.

To fix this vulnerability, it is recommended to update to the fixed versions of TensorFlow when they become available. The fix will be included in TensorFlow 2.5.0 and backported to TensorFlow 2.4.2, 2.3.3, 2.2.3, and 2.1.4.

Related vulnerabilities

Recent vulnerabilities recorded for tensorflow.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 2.1.4 2.1.4
  • >= 2.2.0, < 2.2.3 2.2.3
  • >= 2.3.0, < 2.3.3 2.3.3
  • >= 2.4.0, < 2.4.2 2.4.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback