CVE-2023-25670
📋 TL;DR
This CVE describes a null pointer dereference vulnerability in TensorFlow's QuantizedMatMulWithBiasAndDequantize operation when MKL (Math Kernel Library) is enabled. It affects TensorFlow installations using MKL acceleration, potentially causing crashes or denial of service. Users running TensorFlow with MKL enabled on affected versions are vulnerable.
💻 Affected Systems
- TensorFlow
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Application crash leading to denial of service, potentially disrupting machine learning inference or training pipelines.
Likely Case
Process termination when the vulnerable operation is called with specific inputs, causing service interruption.
If Mitigated
Minimal impact if proper error handling and monitoring are in place to restart affected services.
🎯 Exploit Status
Exploitation requires triggering the specific QuantizedMatMulWithBiasAndDequantize operation with MKL enabled.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 2.12.0 or 2.11.1
Vendor Advisory: https://github.com/tensorflow/tensorflow/security/advisories/GHSA-49rq-hwc3-x77w
Restart Required: Yes
Instructions:
1. Upgrade TensorFlow to version 2.12.0 or 2.11.1 using pip: 'pip install --upgrade tensorflow==2.12.0' 2. Restart all services using TensorFlow.
🔧 Temporary Workarounds
Disable MKL
allDisable Intel MKL acceleration to avoid the vulnerable code path
export TF_DISABLE_MKL=1
export TF_ENABLE_ONEDNN_OPTS=0
🧯 If You Can't Patch
- Disable MKL acceleration using environment variables
- Implement circuit breakers and monitoring to detect and restart crashed services
🔍 How to Verify
Check if Vulnerable:
Check TensorFlow version and MKL status: 'python -c "import tensorflow as tf; print('Version:', tf.__version__); print('MKL enabled:', tf.pywrap_tensorflow.IsMklEnabled())"'
Check Version:
python -c "import tensorflow as tf; print(tf.__version__)"
Verify Fix Applied:
Verify version is 2.12.0 or 2.11.1: 'python -c "import tensorflow as tf; print(tf.__version__)"'
📡 Detection & Monitoring
Log Indicators:
- Segmentation fault or crash logs from TensorFlow processes
- Error messages containing 'QuantizedMatMulWithBiasAndDequantize'
Network Indicators:
- Sudden drop in ML service availability
SIEM Query:
source="tensorflow.log" AND ("segmentation fault" OR "null pointer" OR "QuantizedMatMul")
🔗 References
- https://github.com/tensorflow/tensorflow/commit/8a47a39d9697969206d23a523c977238717e8727
- https://github.com/tensorflow/tensorflow/security/advisories/GHSA-49rq-hwc3-x77w
- https://github.com/tensorflow/tensorflow/commit/8a47a39d9697969206d23a523c977238717e8727
- https://github.com/tensorflow/tensorflow/security/advisories/GHSA-49rq-hwc3-x77w