🔍 CVE-2021-37647

7.7
CVSS Score
HIGH
2021-08-12
2026-06-17 04:00
✅ 완료

🇰🇷 한글 설명

TensorFlow의 tf.raw_ops.SparseTensorSliceDataset 구현에서 유효하지 않은 희소 텐서(sparse tensor) 인자를 제공할 경우 Null 포인터 역참조가 발생할 수 있습니다. 인덱스나 값이 비어 있는 경우에 대한 검증 로직이 미흡하여 프로그램이 비정상적으로 종료될 수 있는 취약점입니다.

💡 쉬운 설명

머신러닝 도구인 TensorFlow에서 잘못된 데이터를 입력하면 프로그램이 갑자기 꺼져버리는 오류가 발생할 수 있습니다. 이는 데이터의 형식이 맞지 않을 때 시스템이 이를 제대로 처리하지 못해 발생하는 문제입니다.

🇺🇸 원문 (English)

TensorFlow is an end-to-end open source platform for machine learning. When a user does not supply arguments that determine a valid sparse tensor, `tf.raw_ops.SparseTensorSliceDataset` implementation can be made to dereference a null pointer. The [implementation](https://github.com/tensorflow/tensorflow/blob/8d72537c6abf5a44103b57b9c2e22c14f5f49698/tensorflow/core/kernels/data/sparse_tensor_slice_dataset_op.cc#L240-L251) has some argument validation but fails to consider the case when either `indices` or `values` are provided for an empty sparse tensor when the other is not. If `indices` is empty, then [code that performs validation](https://github.com/tensorflow/tensorflow/blob/8d72537c6abf5a44103b57b9c2e22c14f5f49698/tensorflow/core/kernels/data/sparse_tensor_slice_dataset_op.cc#L260-L261) (i.e., checking that the indices are monotonically increasing) results in a null pointer dereference. If `indices` as provided by the user is empty, then `indices` in the C++ code above is backed by an empty `std::vector`, hence calling `indices->dim_size(0)` results in null pointer dereferencing (same as calling `std::vector::at()` on an empty vector). We have patched the issue in GitHub commit 02cc160e29d20631de3859c6653184e3f876b9d7. The fix will be included in TensorFlow 2.6.0. We will also cherrypick this commit on TensorFlow 2.5.1, TensorFlow 2.4.3, and TensorFlow 2.3.4, as these are also affected and still in supported range.

📍 영향받는 시스템

TensorFlow 2.6.0 미만 버전 (2.5.1, 2.4.3, 2.3.4 포함)

⚔️ 공격 벡터

조작된 SparseTensor 인자를 포함한 TensorFlow 연산을 실행하여 Null 포인터 역참조 유도

🛡️ 대응 방법

TensorFlow를 2.6.0 이상 버전으로 업데이트하거나, 해당 패치가 적용된 2.5.1, 2.4.3, 2.3.4 버전으로 업데이트하십시오.

🔧 검증 코드

출력된 버전이 2.6.0 미만인지 확인하여 취약 여부를 판단합니다.

Shell / Script
python3 -c 'import tensorflow as tf; print(tf.__version__)'

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H