🇰🇷 한글 설명
TensorFlow에서 RaggedTensor를 사용하는 중 중첩된 tf.map_fn 호출 시 출력 버퍼를 초기화되지 않은 힙 메모리 내용으로 채우는 취약점이 발견되었습니다. 이는 Variant 텐서를 RaggedTensor로 변환할 때 내부 형상 일치 여부를 확인하지 않아 발생하며, 메모리 정보 유출이나 데이터 손실을 초래할 수 있습니다.
💡 쉬운 설명
머신러닝 도구인 TensorFlow에서 특정 방식으로 데이터를 처리할 때, 컴퓨터 메모리에 남아있는 민감한 정보가 실수로 출력될 수 있는 문제입니다. 공격자가 이 기능을 악용하면 시스템 내부의 중요한 데이터를 훔쳐볼 위험이 있습니다.
🇺🇸 원문 (English)
TensorFlow is an end-to-end open source platform for machine learning. In affected versions it is possible to nest a `tf.map_fn` within another `tf.map_fn` call. However, if the input tensor is a `RaggedTensor` and there is no function signature provided, code assumes the output is a fully specified tensor and fills output buffer with uninitialized contents from the heap. The `t` and `z` outputs should be identical, however this is not the case. The last row of `t` contains data from the heap which can be used to leak other memory information. The bug lies in the conversion from a `Variant` tensor to a `RaggedTensor`. The [implementation](https://github.com/tensorflow/tensorflow/blob/460e000de3a83278fb00b61a16d161b1964f15f4/tensorflow/core/kernels/ragged_tensor_from_variant_op.cc#L177-L190) does not check that all inner shapes match and this results in the additional dimensions. The same implementation can result in data loss, if input tensor is tweaked. We have patched the issue in GitHub commit 4e2565483d0ffcadc719bd44893fb7f609bb5f12. 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 포함)
⚔️ 공격 벡터
함수 서명이 없는 RaggedTensor를 입력으로 사용하는 중첩된 tf.map_fn 호출을 통한 메모리 유출
🛡️ 대응 방법
TensorFlow를 2.6.0 이상 버전으로 업데이트하거나, 보안 패치가 적용된 2.5.1, 2.4.3, 2.3.4 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 버전 번호가 2.6.0보다 낮거나 패치된 특정 버전(2.5.1, 2.4.3, 2.3.4) 미만인지 확인합니다.
python3 -c 'import tensorflow as tf; print(tf.__version__)'