🇰🇷 한글 설명
TensorFlow의 `tf.raw_ops.ResourceGather` API에서 사용자가 입력한 `batch_dims` 값이 입력 텐서의 랭스보다 작은지 확인하지 않는 취약점이 발견되었습니다. 이로 인해 디버그 빌드에서는 크래시가 발생할 수 있으며, 릴리스 빌드에서는 힙 할당 데이터의 경계를 벗어난 메모리 읽기가 가능합니다.
💡 쉬운 설명
TensorFlow를 사용할 때 잘못된 설정값을 입력하면 프로그램이 갑자기 꺼지거나, 허용되지 않은 메모리 영역의 데이터를 몰래 읽어갈 수 있는 문제입니다. 이는 데이터의 범위를 제대로 검사하지 않아 발생하는 보안 허점입니다.
🇺🇸 원문 (English)
TensorFlow is an end-to-end open source platform for machine learning. In affected versions an attacker can trigger a crash via a `CHECK`-fail in debug builds of TensorFlow using `tf.raw_ops.ResourceGather` or a read from outside the bounds of heap allocated data in the same API in a release build. The [implementation](https://github.com/tensorflow/tensorflow/blob/f24faa153ad31a4b51578f8181d3aaab77a1ddeb/tensorflow/core/kernels/resource_variable_ops.cc#L660-L668) does not check that the `batch_dims` value that the user supplies is less than the rank of the input tensor. Since the implementation uses several for loops over the dimensions of `tensor`, this results in reading data from outside the bounds of heap allocated buffer backing the tensor. We have patched the issue in GitHub commit bc9c546ce7015c57c2f15c168b3d9201de679a1d. 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 포함)
⚔️ 공격 벡터
악의적으로 조작된 `batch_dims` 값을 포함한 `tf.raw_ops.ResourceGather` 연산을 실행하여 메모리 경계 외 데이터 접근 유도
🛡️ 대응 방법
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__)'