🇰🇷 한글 설명
TensorFlow의 tf.raw_ops.AddManySparseToTensorsMap 함수에서 CHECK-fail을 유발하여 서비스 거부(DoS) 공격이 가능합니다. sparse_shape에 지정된 값이 출력 형상의 차원으로 사용될 때, TensorShape 생성자의 구현 방식 문제로 인해 오버플로가 발생하면 프로그램이 중단됩니다.
💡 쉬운 설명
공격자가 특수하게 조작된 데이터를 입력하면 TensorFlow 프로그램이 갑자기 멈춰버릴 수 있습니다. 이는 프로그램 내부의 검증 과정에서 오류가 발생하여 스스로 작동을 중단하기 때문입니다.
🇺🇸 원문 (English)
TensorFlow is an end-to-end open source platform for machine learning. An attacker can trigger a denial of service via a `CHECK`-fail in `tf.raw_ops.AddManySparseToTensorsMap`. This is because the implementation(https://github.com/tensorflow/tensorflow/blob/6f9896890c4c703ae0a0845394086e2e1e523299/tensorflow/core/kernels/sparse_tensors_map_ops.cc#L257) takes the values specified in `sparse_shape` as dimensions for the output shape. The `TensorShape` constructor(https://github.com/tensorflow/tensorflow/blob/6f9896890c4c703ae0a0845394086e2e1e523299/tensorflow/core/framework/tensor_shape.cc#L183-L188) uses a `CHECK` operation which triggers when `InitDims`(https://github.com/tensorflow/tensorflow/blob/6f9896890c4c703ae0a0845394086e2e1e523299/tensorflow/core/framework/tensor_shape.cc#L212-L296) returns a non-OK status. This is a legacy implementation of the constructor and operations should use `BuildTensorShapeBase` or `AddDimWithStatus` to prevent `CHECK`-failures in the presence of overflows. 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 포함)
⚔️ 공격 벡터
조작된 sparse_shape 값을 포함한 텐서 연산 명령을 TensorFlow에 전달
🛡️ 대응 방법
TensorFlow를 2.5.0 이상의 최신 버전으로 업데이트하거나 해당 보안 패치가 적용된 버전으로 업그레이드
🔧 검증 코드
출력된 버전 번호가 2.5.0보다 낮은지 확인하여 취약 여부를 판단합니다.
python3 -c 'import tensorflow as tf; print(tf.__version__)'