CVE-2021-37681

7.8 HIGH

📋 TL;DR

This CVE describes a null pointer dereference vulnerability in TensorFlow's TFLite SVDF implementation. Attackers could cause denial of service or potentially execute arbitrary code by exploiting improper null pointer handling. Users running affected TensorFlow versions with TFLite models using SVDF operations are vulnerable.

💻 Affected Systems

Products:
  • TensorFlow
  • TensorFlow Lite
Versions: TensorFlow 2.3.0 to 2.3.3, 2.4.0 to 2.4.2, 2.5.0, and 2.6.0-rc0
Operating Systems: All platforms running affected TensorFlow versions
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects TFLite models using SVDF operations. Standard TensorFlow (not Lite) is not affected.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise if combined with other vulnerabilities, or denial of service causing application crashes.

🟠

Likely Case

Application crashes or denial of service when processing malicious TFLite models containing SVDF operations with null pointer triggers.

🟢

If Mitigated

Application stability issues or crashes contained within the TensorFlow process without system-wide impact.

🌐 Internet-Facing: MEDIUM - Requires processing of malicious TFLite models, which could be uploaded to ML inference services.
🏢 Internal Only: MEDIUM - Internal ML pipelines processing untrusted models could be affected.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Exploitation requires crafting malicious TFLite models that trigger the null pointer condition in SVDF operations.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: TensorFlow 2.6.0, 2.5.1, 2.4.3, and 2.3.4

Vendor Advisory: https://github.com/tensorflow/tensorflow/security/advisories/GHSA-7xwj-5r4v-429p

Restart Required: No

Instructions:

1. Update TensorFlow to patched version: pip install --upgrade tensorflow==2.6.0 (or appropriate version). 2. Rebuild any applications using TensorFlow. 3. Test TFLite models with SVDF operations.

🔧 Temporary Workarounds

Disable SVDF operations

all

Avoid using SVDF operations in TFLite models until patched

Input validation

all

Implement strict validation of TFLite model inputs before processing

🧯 If You Can't Patch

  • Isolate TensorFlow applications in containers with limited privileges
  • Implement network segmentation to restrict access to ML inference services

🔍 How to Verify

Check if Vulnerable:

Check TensorFlow version: python -c 'import tensorflow as tf; print(tf.__version__)' and compare with affected versions.

Check Version:

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

Verify Fix Applied:

Verify TensorFlow version is 2.6.0+, 2.5.1+, 2.4.3+, or 2.3.4+. Test SVDF operations in TFLite models.

📡 Detection & Monitoring

Log Indicators:

  • Segmentation faults
  • Null pointer exceptions
  • TensorFlow/TFLite process crashes

Network Indicators:

  • Unusual TFLite model uploads to ML services
  • Repeated inference failures

SIEM Query:

process_name:tensorflow AND (event_type:crash OR error_message:"null pointer" OR error_message:"segmentation fault")

🔗 References

📤 Share & Export