CVE-2021-29614

7.1 HIGH

📋 TL;DR

This vulnerability in TensorFlow's tf.io.decode_raw function allows out-of-bounds memory writes when combining fixed_length with wider datatypes, potentially leading to interpreter crashes or memory corruption. All TensorFlow users running affected versions are impacted, particularly those processing untrusted input data.

💻 Affected Systems

Products:
  • TensorFlow
Versions: TensorFlow 2.1.0 to 2.4.1, 2.3.0 to 2.3.2, 2.2.0 to 2.2.2, 2.1.0 to 2.1.3
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Any system using tf.io.decode_raw with fixed_length parameter and wider datatypes is vulnerable. The vulnerability is in the core library and affects all deployments.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution or complete system compromise through memory corruption attacks, potentially allowing attackers to execute arbitrary code in the context of the TensorFlow process.

🟠

Likely Case

Application crashes, denial of service, or memory corruption leading to unpredictable behavior and potential data corruption.

🟢

If Mitigated

Limited impact if input validation and sandboxing prevent exploitation, though crashes may still occur with malformed inputs.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Proof of concept demonstrates interpreter crash. The memory corruption primitive could be weaponized for more severe attacks, though this requires additional exploitation techniques.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: TensorFlow 2.5.0, 2.4.2, 2.3.3, 2.2.3, 2.1.4

Vendor Advisory: https://github.com/tensorflow/tensorflow/security/advisories/GHSA-8pmx-p244-g88h

Restart Required: No

Instructions:

1. Upgrade TensorFlow to patched version: pip install --upgrade tensorflow==2.5.0 (or appropriate version). 2. Verify installation with: python -c 'import tensorflow as tf; print(tf.__version__)'. 3. Test that tf.io.decode_raw functions correctly with fixed_length parameter.

🔧 Temporary Workarounds

Avoid tf.io.decode_raw with fixed_length

all

Temporarily avoid using tf.io.decode_raw with the fixed_length parameter until patched.

Input validation and sanitization

all

Implement strict input validation for any data passed to tf.io.decode_raw, particularly checking fixed_length parameter values.

🧯 If You Can't Patch

  • Implement strict input validation and sanitization for all data passed to tf.io.decode_raw
  • Isolate TensorFlow processes in containers or sandboxes to limit potential damage from exploitation

🔍 How to Verify

Check if Vulnerable:

Check TensorFlow version: python -c 'import tensorflow as tf; print(tf.__version__)'. If version is between 2.1.0-2.4.1 (excluding patched versions), you are vulnerable.

Check Version:

python -c 'import tensorflow as tf; print(tf.__version__)'

Verify Fix Applied:

After patching, test tf.io.decode_raw with fixed_length parameter using known problematic inputs to ensure no crashes occur.

📡 Detection & Monitoring

Log Indicators:

  • Python interpreter crashes
  • Segmentation faults in TensorFlow processes
  • Memory access violation errors

Network Indicators:

  • Unusual patterns of data being sent to TensorFlow services
  • Repeated connection attempts followed by service crashes

SIEM Query:

source="tensorflow" AND (event_type="crash" OR error="segmentation fault" OR error="memory access violation")

🔗 References

📤 Share & Export