🇰🇷 한글 설명
TensorFlow의 QuantizedReshape 연산 과정에서 잘못된 양자화 임계값을 전달할 경우 힙 버퍼 오버플로가 발생할 수 있습니다. 이는 구현 과정에서 입력 텐서가 비어 있을 경우를 고려하지 않고 요소에 직접 접근하기 때문에 발생합니다.
💡 쉬운 설명
머신러닝 도구인 TensorFlow에서 데이터 형식을 변환할 때, 비어 있는 데이터를 처리하는 과정에서 메모리 오류가 발생할 수 있습니다. 공격자가 특수하게 조작된 데이터를 입력하면 프로그램이 예상치 못한 동작을 하거나 멈출 수 있습니다.
🇺🇸 원문 (English)
TensorFlow is an end-to-end open source platform for machine learning. An attacker can cause a heap buffer overflow in `QuantizedReshape` by passing in invalid thresholds for the quantization. This is because the implementation(https://github.com/tensorflow/tensorflow/blob/a324ac84e573fba362a5e53d4e74d5de6729933e/tensorflow/core/kernels/quantized_reshape_op.cc#L38-L55) assumes that the 2 arguments are always valid scalars and tries to access the numeric value directly. However, if any of these tensors is empty, then `.flat<T>()` is an empty buffer and accessing the element at position 0 results in overflow. 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 포함)
⚔️ 공격 벡터
양자화 임계값으로 유효하지 않거나 비어 있는 텐서를 입력하여 힙 버퍼 오버플로 유도
🛡️ 대응 방법
TensorFlow를 2.5.0 이상의 최신 버전으로 업데이트하거나 해당 보안 패치가 적용된 버전으로 업그레이드
🔧 검증 코드
출력된 버전이 2.5.0 미만인 경우 해당 취약점에 노출된 상태입니다.
python3 -c 'import tensorflow as tf; print(tf.__version__)'