🇰🇷 한글 설명
TensorFlow의 tf.raw_ops.MatrixDiagV* 연산에서 k 값의 유효성을 검증하는 과정이 불완전하여 발생하는 취약점입니다. 공격자가 빈 텐서를 입력할 경우 널 포인터 참조로 인해 정의되지 않은 동작을 유발할 수 있습니다.
💡 쉬운 설명
머신러닝 도구인 TensorFlow에서 데이터의 개수를 제대로 확인하지 않아 발생하는 오류입니다. 잘못된 데이터를 입력하면 프로그램이 예상치 못한 방식으로 작동하거나 멈출 수 있습니다.
🇺🇸 원문 (English)
TensorFlow is an end-to-end open source platform for machine learning. In affected versions an attacker can cause undefined behavior via binding a reference to null pointer in all operations of type `tf.raw_ops.MatrixDiagV*`. The [implementation](https://github.com/tensorflow/tensorflow/blob/84d053187cb80d975ef2b9684d4b61981bca0c41/tensorflow/core/kernels/linalg/matrix_diag_op.cc) has incomplete validation that the value of `k` is a valid tensor. We have check that this value is either a scalar or a vector, but there is no check for the number of elements. If this is an empty tensor, then code that accesses the first element of the tensor is wrong. We have patched the issue in GitHub commit f2a673bd34f0d64b8e40a551ac78989d16daad09. 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 포함)
⚔️ 공격 벡터
tf.raw_ops.MatrixDiagV* 연산에 요소가 없는 빈 텐서를 입력값으로 전달
🛡️ 대응 방법
TensorFlow를 2.6.0 이상 버전으로 업데이트하거나 패치가 적용된 2.5.1, 2.4.3, 2.3.4 버전으로 업데이트
🔧 검증 코드
출력된 버전 번호가 2.6.0 미만인지 확인하여 취약 여부를 판단합니다.
python3 -c 'import tensorflow as tf; print(tf.__version__)'