🇰🇷 한글 설명
TensorFlow의 RaggedBincount 함수에서 splits 인자에 유효하지 않은 SparseTensor가 전달될 경우 힙 버퍼 오버플로우가 발생할 수 있습니다. 공격자가 조작된 데이터를 통해 splits 텐서 버퍼의 범위를 벗어난 메모리 읽기를 유도할 수 있는 취약점입니다.
💡 쉬운 설명
머신러닝 도구인 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-L433). Before the `for` loop, `batch_idx` is set to 0. The user controls the `splits` array, making it contain only one element, 0. Thus, the code in the `while` loop would increment `batch_idx` and then try to read `splits(1)`, which is outside of bounds. 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 연산 시 조작된 SparseTensor를 splits 인자로 전달하여 메모리 경계 외 읽기 유도
🛡️ 대응 방법
TensorFlow를 2.5.0 이상 버전으로 업데이트하거나, 해당 버전의 보안 패치가 적용된 2.4.2 또는 2.3.3 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 버전 번호가 2.5.0 미만인지 확인하여 취약 여부를 판단합니다.
python3 -c 'import tensorflow as tf; print(tf.__version__)'