🇰🇷 한글 설명
TensorFlow의 `tf.raw_ops.FusedBatchNorm` 구현에서 힙 버퍼 오버플로우 취약점이 발견되었습니다. 입력 텐서의 scale, offset, mean, variance 요소 수가 x의 채널 수와 일치하는지 검증하지 않아 힙 경계를 벗어난 읽기가 발생하거나, 빈 텐서의 경우 Null 포인터 역참조로 인한 정의되지 않은 동작이 발생할 수 있습니다.
💡 쉬운 설명
머신러닝 도구인 TensorFlow에서 데이터 크기를 잘못 계산하여 메모리의 허용된 범위를 넘어 읽는 오류가 있습니다. 이로 인해 프로그램이 갑자기 종료되거나 예상치 못한 동작을 일으킬 수 있습니다.
🇺🇸 원문 (English)
TensorFlow is an end-to-end open source platform for machine learning. The implementation of `tf.raw_ops.FusedBatchNorm` is vulnerable to a heap buffer overflow. If the tensors are empty, the same implementation can trigger undefined behavior by dereferencing null pointers. The implementation(https://github.com/tensorflow/tensorflow/blob/57d86e0db5d1365f19adcce848dfc1bf89fdd4c7/tensorflow/core/kernels/fused_batch_norm_op.cc) fails to validate that `scale`, `offset`, `mean` and `variance` (the last two only when required) all have the same number of elements as the number of channels of `x`. This results in heap out of bounds reads when the buffers backing these tensors are indexed past their boundary. If the tensors are empty, the validation mentioned in the above paragraph would also trigger and prevent the undefined behavior. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2, TensorFlow 2.3.3, TensorFlow 2.2.3 and TensorFlow 2.1.4, as these are also affected and still in supported range.
📍 영향받는 시스템
TensorFlow 2.5.0 미만 버전 (2.4.2, 2.3.3, 2.2.3, 2.1.4 포함)
⚔️ 공격 벡터
조작된 크기의 텐서를 `tf.raw_ops.FusedBatchNorm` 연산에 입력하여 메모리 경계 밖의 데이터를 읽도록 유도
🛡️ 대응 방법
TensorFlow를 2.5.0 이상 버전으로 업데이트하거나, 사용 중인 지원 버전의 보안 패치(2.4.2, 2.3.3 등)를 적용
🔧 검증 코드
출력된 버전이 2.5.0 미만인 경우 해당 취약점에 노출되어 있을 가능성이 높습니다.
python3 -c 'import tensorflow as tf; print(tf.__version__)'