🇰🇷 한글 설명
TensorFlow의 `tf.raw_ops.FractionalAvgPool` 연산에서 사용자가 제어 가능한 입력값에 의해 0으로 나누기 오류가 발생할 수 있습니다. 이로 인해 런타임 오류가 발생하며 서비스 거부(DoS) 상태에 빠질 수 있습니다.
💡 쉬운 설명
머신러닝 도구인 TensorFlow에서 특정 계산을 수행할 때 숫자를 0으로 나누는 실수가 발생할 수 있습니다. 공격자가 이 점을 이용하면 프로그램이 갑자기 멈추게 만들 수 있습니다.
🇺🇸 원문 (English)
TensorFlow is an end-to-end open source platform for machine learning. An attacker can cause a runtime division by zero error and denial of service in `tf.raw_ops.FractionalAvgPool`. This is because the implementation(https://github.com/tensorflow/tensorflow/blob/acc8ee69f5f46f92a3f1f11230f49c6ac266f10c/tensorflow/core/kernels/fractional_avg_pool_op.cc#L85-L89) computes a divisor quantity by dividing two user controlled values. The user controls the values of `input_size[i]` and `pooling_ratio_[i]` (via the `value.shape()` and `pooling_ratio` arguments). If the value in `input_size[i]` is smaller than the `pooling_ratio_[i]`, then the floor operation results in `output_size[i]` being 0. The `DCHECK_GT` line is a no-op outside of debug mode, so in released versions of TF this does not trigger. Later, these computed values are used as arguments(https://github.com/tensorflow/tensorflow/blob/acc8ee69f5f46f92a3f1f11230f49c6ac266f10c/tensorflow/core/kernels/fractional_avg_pool_op.cc#L96-L99) to `GeneratePoolingSequence`(https://github.com/tensorflow/tensorflow/blob/acc8ee69f5f46f92a3f1f11230f49c6ac266f10c/tensorflow/core/kernels/fractional_pool_common.cc#L100-L108). There, the first computation is a division in a modulo operation. Since `output_length` can be 0, this results in runtime crashing. 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 포함)
⚔️ 공격 벡터
조작된 `input_size` 및 `pooling_ratio` 값을 포함한 입력 데이터를 전달하여 런타임 오류 유도
🛡️ 대응 방법
TensorFlow를 2.5.0 이상 버전으로 업데이트하거나 해당 보안 패치가 적용된 버전으로 업그레이드
🔧 검증 코드
출력된 버전이 2.5.0 미만인 경우 해당 취약점에 노출되어 있습니다.
python3 -c 'import tensorflow as tf; print(tf.__version__)'