🇰🇷 한글 설명
TensorFlow의 RaggedBincount 함수에서 splits 인자에 유효하지 않은 SparseTensor를 전달할 경우 힙 버퍼 오버플로우가 발생할 수 있습니다. 이 취약점은 구현 과정에서 텐서 버퍼 범위를 벗어난 읽기/쓰기를 유발하여 시스템 불안정성을 초래합니다.
💡 쉬운 설명
머신러닝 도구인 TensorFlow에서 특정 데이터를 잘못 입력하면 프로그램이 허용되지 않은 메모리 영역을 건드리는 문제가 있습니다. 이로 인해 프로그램이 갑자기 종료되거나 보안 문제가 생길 수 있습니다.
🇺🇸 원문 (English)
TensorFlow is an end-to-end open source platform for machine learning. If the `splits` argument of `RaggedBincount` does not specify a valid `SparseTensor`(https://www.tensorflow.org/api_docs/python/tf/sparse/SparseTensor), then an attacker can trigger a heap buffer overflow. This will cause a read from outside the bounds of the `splits` tensor buffer in the implementation of the `RaggedBincount` op(https://github.com/tensorflow/tensorflow/blob/8b677d79167799f71c42fd3fa074476e0295413a/tensorflow/core/kernels/bincount_op.cc#L430-L446). Before the `for` loop, `batch_idx` is set to 0. The attacker sets `splits(0)` to be 7, hence the `while` loop does not execute and `batch_idx` remains 0. This then results in writing to `out(-1, bin)`, which is before the heap allocated buffer for the output tensor. The fix will be included in TensorFlow 2.5.0. We will also cherrypick this commit on TensorFlow 2.4.2 and TensorFlow 2.3.3, as these are also affected.
📍 영향받는 시스템
TensorFlow 2.5.0 미만 버전 (2.4.2, 2.3.3 포함)
⚔️ 공격 벡터
RaggedBincount 함수의 splits 인자에 조작된 SparseTensor를 입력하여 힙 버퍼 오버플로우 유도
🛡️ 대응 방법
TensorFlow를 2.5.0 이상의 최신 버전으로 업데이트하거나, 해당 패치가 적용된 2.4.2 또는 2.3.3 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 버전 번호가 2.5.0 미만인지 확인하여 취약 여부를 판단합니다.
python3 -c 'import tensorflow as tf; print(tf.__version__)'